Panda3D
Functions
renderEffects.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "renderEffects.h"
#include "billboardEffect.h"
#include "decalEffect.h"
#include "compassEffect.h"
#include "polylightEffect.h"
#include "showBoundsEffect.h"
#include "config_pgraph.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "datagramIterator.h"
#include "indent.h"
#include "compareTo.h"
#include "lightReMutexHolder.h"
#include "lightMutexHolder.h"
#include "thread.h"
#include <iterator>

Go to the source code of this file.

Functions

 CPT (TransformState) RenderEffects
 Preprocesses the accumulated transform that is about to be applied to (or through) this node due to a flatten operation. More...
 
 CPT (RenderEffects) RenderEffects
 Returns a RenderEffects with one effect set. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
2002-03-14

Definition in file renderEffects.cxx.

Function Documentation

◆ CPT() [1/2]

CPT ( TransformState  )

Preprocesses the accumulated transform that is about to be applied to (or through) this node due to a flatten operation.

The returned value will be used instead. Returns true if all of the effects in this set can safely be shared with a sibling node that has the exact same set of effects, or false if this would be bad for any of the effects. Returns a new RenderEffects transformed by the indicated matrix. Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially different ones in a big set and throw away the rest.

This method is not needed outside of the RenderEffects class because all equivalent RenderEffects objects are guaranteed to share the same pointer; thus, a pointer comparison is always sufficient. Searches for an effect with the indicated type in the state, and returns its index if it is found, or -1 if it is not. Returns a RenderEffects with no effects set.

Definition at line 86 of file renderEffects.cxx.

References ordered_vector< Key, Compare, Vector >::begin(), and ordered_vector< Key, Compare, Vector >::end().

◆ CPT() [2/2]

CPT ( RenderEffects  )

Returns a RenderEffects with one effect set.

This function is used to share a common RenderEffects pointer for all equivalent RenderEffects objects.

Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added.

Returns a RenderEffects with four effects set.

Returns a RenderEffects with three effects set.

Returns a RenderEffects with two effects set.

If there is already a RenderEffect with the same type, it is replaced. Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed. Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not. This method overrides ReferenceCount::unref() to check whether the remaining reference count is entirely in the cache, and if so, it checks for and breaks a cycle in the cache involving this object. This is designed to prevent leaks from cyclical references within the cache.

Note that this is not a virtual method, and cannot be because ReferenceCount itself declares no virtual methods (it avoids the overhead of a virtual function pointer). But this doesn't matter, because PT(TransformState) is a template class, and will call the appropriate method even though it is non-virtual. Returns the total number of unique RenderEffects objects allocated in the world. This will go up and down during normal operations.

See the similar logic in RenderEffect. The idea is to create a new RenderEffects object and pass it through this function, which will share the pointer with a previously-created RenderEffects object if it is equivalent.

Definition at line 190 of file renderEffects.cxx.

References ordered_vector< Key, Compare, Vector >::reserve().