Panda3D
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
CullBinStateSorted Class Reference

A specific kind of CullBin that sorts geometry to collect items of the same state together, so that minimal state changes are required on the GSG to render them. More...

#include "cullBinStateSorted.h"

Inheritance diagram for CullBinStateSorted:
CullBin TypedReferenceCount CullBinEnums TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Classes

class  ObjectData

Public Member Functions

 CullBinStateSorted (const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
virtual void add_object (CullableObject *object, Thread *current_thread)
 Adds a geom, along with its associated state, to the bin for rendering.
virtual void draw (bool force, Thread *current_thread)
 Draws all the geoms in the bin, in the appropriate order.
virtual void finish_cull (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.
virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
static CullBinmake_bin (const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
 Factory constructor for passing to the CullBinManager.

Protected Member Functions

virtual void fill_result_graph (ResultGraphBuilder &builder)
 Called by CullBin::make_result_graph() to add all the geoms to the special cull result scene graph.

Detailed Description

A specific kind of CullBin that sorts geometry to collect items of the same state together, so that minimal state changes are required on the GSG to render them.

This also sorts objects front-to-back within a particular state, to take advantage of hierarchical Z-buffer algorithms which can early-out when an object appears behind another one.

Definition at line 39 of file cullBinStateSorted.h.


Member Function Documentation

void CullBinStateSorted::add_object ( CullableObject object,
Thread current_thread 
) [virtual]

Adds a geom, along with its associated state, to the bin for rendering.

Implements CullBin.

Definition at line 58 of file cullBinStateSorted.cxx.

void CullBinStateSorted::draw ( bool  force,
Thread current_thread 
) [virtual]

Draws all the geoms in the bin, in the appropriate order.

Implements CullBin.

Definition at line 85 of file cullBinStateSorted.cxx.

void CullBinStateSorted::fill_result_graph ( CullBin::ResultGraphBuilder builder) [protected, virtual]

Called by CullBin::make_result_graph() to add all the geoms to the special cull result scene graph.

Implements CullBin.

Definition at line 101 of file cullBinStateSorted.cxx.

References CullBin::ResultGraphBuilder::add_object().

void CullBinStateSorted::finish_cull ( SceneSetup scene_setup,
Thread current_thread 
) [virtual]

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.

Reimplemented from CullBin.

Definition at line 72 of file cullBinStateSorted.cxx.

static void CullBinStateSorted::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from CullBin.

Definition at line 73 of file cullBinStateSorted.h.

References CullBin::init_type().

CullBin * CullBinStateSorted::make_bin ( const string &  name,
GraphicsStateGuardianBase gsg,
const PStatCollector draw_region_pcollector 
) [static]

Factory constructor for passing to the CullBinManager.

Definition at line 46 of file cullBinStateSorted.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations