#include <cullResult.h>
Inheritance diagram for CullResult:
Public Member Functions | |
CullResult (GraphicsStateGuardianBase *gsg) | |
~CullResult () | |
PointerTo< CullResult > | make_next () const |
Returns a newly-allocated CullResult object that contains a copy of just the subset of the data from this CullResult object that is worth keeping around for next frame. | |
CullBin * | get_bin (int bin_index) |
Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid. | |
void | add_object (CullableObject *object) |
Adds the indicated CullableObject to the appropriate bin. | |
void | finish_cull () |
Called after all the geoms have been added, this indicates that the cull process is finished for this frame and gives the bins a chance to do any post-processing (like sorting) before moving on to draw. | |
void | draw () |
Asks all the bins to draw themselves in the correct order. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
void | bin_removed (int bin_index) |
Intended to be called by CullBinManager::remove_bin(), this informs all the CullResults in the world to remove the indicated bin_index from their cache if it has been cached. | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef pvector< PointerTo< CullBin > > | Bins |
typedef pset< CullResult * > | CullResults |
Private Member Functions | |
CullBin * | make_new_bin (int bin_index) |
Allocates a new CullBin for the given bin_index and stores it for next time. | |
Static Private Member Functions | |
ConstPointerTo< RenderState > | get_binary_state () |
Returns a RenderState that applies the effects of M_binary. | |
ConstPointerTo< RenderState > | get_dual_transparent_state () |
Returns a RenderState that renders only the transparent parts of an object, in support of M_dual. | |
ConstPointerTo< RenderState > | get_dual_transparent_state_decals () |
Returns a RenderState that renders only the transparent parts of an object, but suitable for objects that contain decals. | |
ConstPointerTo< RenderState > | get_dual_opaque_state () |
Returns a RenderState that renders only the opaque parts of an object, in support of M_dual. | |
Private Attributes | |
GraphicsStateGuardianBase * | _gsg |
Bins | _bins |
Static Private Attributes | |
CullResults | _cull_results |
This is also used to keep the results of last frame's cull traversal around to make next frame's traversal of the same scene a little easier.
Definition at line 60 of file cullResult.h.
|
Definition at line 86 of file cullResult.h. |
|
Definition at line 89 of file cullResult.h. |
|
Definition at line 32 of file cullResult.I. References INLINE. |
|
Definition at line 46 of file cullResult.I. References _bins, INLINE, make_new_bin(), and NULL. |
|
Adds the indicated CullableObject to the appropriate bin. The bin becomes the owner of the object pointer, and will eventually delete it. Definition at line 97 of file cullResult.cxx. References CullableObject::_state, CullBin::add_object(), RenderState::compose(), CPT, get_bin(), RenderState::get_bin(), CullBinAttrib::get_bin_name(), get_dual_opaque_state(), get_dual_transparent_state(), get_dual_transparent_state_decals(), CullableObject::has_decals(), m_dual_opaque, nassertv, and NULL. |
|
Intended to be called by CullBinManager::remove_bin(), this informs all the CullResults in the world to remove the indicated bin_index from their cache if it has been cached.
Definition at line 227 of file cullResult.cxx. References CPT, RenderState::get_max_priority(), RenderAttrib::M_greater_equal, TransparencyAttrib::M_none, TransparencyAttrib::make(), AlphaTestAttrib::make(), RenderState::make(), and NULL. |
|
Asks all the bins to draw themselves in the correct order.
Definition at line 198 of file cullResult.cxx. |
|
Called after all the geoms have been added, this indicates that the cull process is finished for this frame and gives the bins a chance to do any post-processing (like sorting) before moving on to draw.
Definition at line 178 of file cullResult.cxx. |
|
Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid. If there is the first time this bin_index has been requested for this CullResult, creates a new CullBin object on the fly. Definition at line 66 of file cullResult.I. Referenced by add_object(). |
|
Returns a RenderState that applies the effects of M_binary.
Definition at line 269 of file cullResult.cxx. References RenderState::add_attrib(), CPT, ClockObject::get_global_clock(), ClockObject::get_real_time(), m_dual_flash_rate, RenderAttrib::M_less, AlphaTestAttrib::make(), ColorScaleAttrib::make(), and NULL. |
|
|
Returns a RenderState that renders only the opaque parts of an object, in support of M_dual.
Definition at line 383 of file cullResult.cxx. Referenced by add_object(). |
|
Returns a RenderState that renders only the transparent parts of an object, in support of M_dual. This state is suitable only for objects that do not contain decals. Definition at line 298 of file cullResult.cxx. Referenced by add_object(). |
|
Returns a RenderState that renders only the transparent parts of an object, but suitable for objects that contain decals.
Definition at line 344 of file cullResult.cxx. Referenced by add_object(). |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
|
Allocates a new CullBin for the given bin_index and stores it for next time.
Definition at line 243 of file cullResult.cxx. References CPT, RenderState::get_max_priority(), TransparencyAttrib::M_alpha, RenderAttrib::M_greater, TransparencyAttrib::make(), AlphaTestAttrib::make(), RenderState::make(), and NULL. Referenced by ~CullResult(). |
|
Returns a newly-allocated CullResult object that contains a copy of just the subset of the data from this CullResult object that is worth keeping around for next frame.
Definition at line 68 of file cullResult.cxx. |
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Definition at line 87 of file cullResult.h. Referenced by finish_cull(), and ~CullResult(). |
|
Definition at line 90 of file cullResult.h. |
|
Definition at line 84 of file cullResult.h. |