Panda3D
Public Member Functions | Static Public Member Functions | List of all members
CullResult Class Reference

This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order. More...

Inheritance diagram for CullResult:
ReferenceCount

Public Member Functions

 __init__ (const CullResult)
 
 addObject (CullableObject object, const CullTraverser traverser)
 Adds the indicated CullableObject to the appropriate bin. More...
 
 draw (Thread current_thread)
 Asks all the bins to draw themselves in the correct order. More...
 
 finishCull (SceneSetup scene_setup, Thread current_thread)
 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. More...
 
CullBin getBin (int bin_index)
 Returns the CullBin associated with the indicated bin_index, or NULL if the bin_index is invalid. More...
 
CullResult makeNext ()
 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. More...
 
PandaNode makeResultGraph ()
 Returns a special scene graph constructed to represent the results of the cull. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Additional Inherited Members

- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

Detailed Description

This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order.

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.

Member Function Documentation

◆ __init__()

__init__ ( const  CullResult)

◆ addObject()

addObject ( CullableObject  object,
const CullTraverser  traverser 
)

Adds the indicated CullableObject to the appropriate bin.

The bin becomes the owner of the object pointer, and will eventually delete it.

◆ draw()

draw ( Thread  current_thread)

Asks all the bins to draw themselves in the correct order.

◆ finishCull()

finishCull ( SceneSetup  scene_setup,
Thread  current_thread 
)

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.

◆ getBin()

CullBin getBin ( int  bin_index)

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.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ makeNext()

CullResult makeNext ( )

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.

◆ makeResultGraph()

PandaNode makeResultGraph ( )

Returns a special scene graph constructed to represent the results of the cull.

This will be a hierarchy of nodes, one node for each bin, each of which will in term be a parent of a number of GeomNodes, representing the geometry drawn in each bin.

This is useful mainly for high-level debugging and abstraction tools; it should not be mistaken for the low-level cull result itself. For the low- level cull result, use draw() to efficiently draw the culled scene.