#include <pgCullTraverser.h>
Inheritance diagram for PGCullTraverser:
Public Member Functions | |
PGCullTraverser (PGTop *top, CullTraverser *trav) | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
void | set_scene (SceneSetup *scene_setup) |
Sets the SceneSetup object that indicates the initial camera position, etc. | |
SceneSetup * | get_scene () const |
Returns the SceneSetup object. | |
void | set_camera_mask (const DrawMask &camera_mask) |
Specifies the visibility mask from the camera viewing the scene. | |
const DrawMask & | get_camera_mask () const |
Returns the visibility mask from the camera viewing the scene. | |
const TransformState * | get_camera_transform () const |
Returns the position of the camera relative to the starting node, without any compensating coordinate-system transforms that might have been introduced for the purposes of rendering. | |
const TransformState * | get_render_transform () const |
Returns the position of the starting node relative to the camera, pretransformed as appropriate for rendering. | |
void | set_initial_state (const RenderState *initial_state) |
Sets the initial RenderState at the top of the scene graph we are traversing. | |
const RenderState * | get_initial_state () const |
Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set. | |
void | set_depth_offset_decals (bool flag) |
Sets the depth_offset_decals flag. | |
bool | get_depth_offset_decals () const |
Returns the depth_offset_decals flag. | |
void | set_view_frustum (GeometricBoundingVolume *view_frustum) |
Specifies the bounding volume that corresponds to the view frustum. | |
GeometricBoundingVolume * | get_view_frustum () const |
Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set. | |
void | set_guard_band (GeometricBoundingVolume *guard_band) |
Specifies the bounding volume to use for detecting guard band clipping. | |
GeometricBoundingVolume * | get_guard_band () const |
Returns the bounding volume that corresponds to the guard band, or NULL if the guard band is not in use or has not been set. | |
void | set_cull_handler (CullHandler *cull_handler) |
Specifies the object that will receive the culled Geoms. | |
CullHandler * | get_cull_handler () const |
Returns the object that will receive the culled Geoms. | |
void | traverse (const NodePath &root) |
Begins the traversal from the indicated node. | |
void | traverse (CullTraverserData &data) |
Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space. | |
void | traverse_below (CullTraverserData &data) |
Traverses all the children of the indicated node, with the given data, which been converted into the node's space. | |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Public Attributes | |
PGTop * | _top |
int | _sort_index |
Static Private Attributes | |
TypeHandle | _type_handle |
It is substituted in for the normal CullTraverser by the PGTop node. Its purpose is to carry additional data through the traversal so that PGItems can know how to register their regions with the current MouseWatcherGroup.
Definition at line 47 of file pgCullTraverser.h.
|
Definition at line 32 of file pgCullTraverser.I. |
|
Reimplemented from CullTraverser. Definition at line 66 of file pgCullTraverser.h. |
|
Returns the visibility mask from the camera viewing the scene.
Definition at line 199 of file cullTraverser.I. References CullTraverser::_guard_band, and INLINE. |
|
Returns the position of the camera relative to the starting node, without any compensating coordinate-system transforms that might have been introduced for the purposes of rendering.
Definition at line 68 of file cullTraverser.I. References CullTraverser::_scene_setup, and INLINE. Referenced by LODNode::xform(). |
|
Reimplemented from CullTraverser. Definition at line 55 of file pgCullTraverser.h. References CullTraverser::get_class_type(), and CullTraverser::init_type(). |
|
Returns the object that will receive the culled Geoms.
Definition at line 343 of file cullTraverser.I. |
|
Returns the depth_offset_decals flag. See set_depth_offset_decals(). Definition at line 167 of file cullTraverser.I. References CullTraverser::_view_frustum, and INLINE. |
|
Returns the bounding volume that corresponds to the guard band, or NULL if the guard band is not in use or has not been set. Note that the guard band returned here is always in the coordinate space of the starting node, not the current node, even if it is sampled during a traversal. To get the guard band in the current node's coordinate space, check in the current CullTraverserData. Definition at line 313 of file cullTraverser.I. |
|
Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set.
Definition at line 131 of file cullTraverser.I. References CullTraverser::_camera_mask. |
|
Returns the position of the starting node relative to the camera, pretransformed as appropriate for rendering. Note that this value is always the position of the starting node, not the current node, even if it is sampled during a traversal. To get the render transform of the current node check in the current CullTraverserData. Definition at line 97 of file cullTraverser.I. References CullTraverser::_depth_offset_decals, and INLINE. |
|
Returns the SceneSetup object.
Definition at line 49 of file cullTraverser.I. References CullTraverser::_scene_setup, and INLINE. |
|
Reimplemented from CullTraverser. Definition at line 63 of file pgCullTraverser.h. |
|
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). Definition at line 71 of file typedObject.I. References TypeHandle::get_name(), TypedObject::get_type(), and INLINE. |
|
Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set. Note that the view frustum returned here is always in the coordinate space of the starting node, not the current node, even if it is sampled during a traversal. To get the view frustum in the current node's coordinate space, check in the current CullTraverserData. Definition at line 247 of file cullTraverser.I. |
|
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 CullTraverser. Definition at line 58 of file pgCullTraverser.h. |
|
Returns true if the current object is the indicated type exactly.
Definition at line 101 of file typedObject.I. Referenced by PT(), and CollisionNode::xform(). |
|
|
Specifies the visibility mask from the camera viewing the scene. Any nodes that do not have at least some bits in common with this mask will not be drawn. Definition at line 184 of file cullTraverser.I. References CullTraverser::_guard_band, and INLINE. |
|
Specifies the object that will receive the culled Geoms. This must be set before calling traverse(). Definition at line 328 of file cullTraverser.I. |
|
Sets the depth_offset_decals flag. If this is true, decals will be rendered using DepthOffsetAttribs; otherwise, decals will be rendered with a more expensive three-pass system. This is normally set from the corresponding flag in the GSG. Definition at line 152 of file cullTraverser.I. References CullTraverser::_view_frustum, and INLINE. |
|
Specifies the bounding volume to use for detecting guard band clipping. This is a render optimization for certain cards that support this feature; the guard band is a 2-d area than the frame buffer. If a primitive will appear entirely within the guard band after perspective transform, it may be drawn correctly with clipping disabled, for a small performance gain. This is the bounding volume that corresponds to the 2-d guard band. If a primitive is entirely within this area, clipping will be disabled on the GSG. Definition at line 282 of file cullTraverser.I. |
|
Sets the initial RenderState at the top of the scene graph we are traversing. If this is not set, the default is the empty state. Definition at line 114 of file cullTraverser.I. References CullTraverser::_depth_offset_decals, and INLINE. |
|
Sets the SceneSetup object that indicates the initial camera position, etc. This must be called before traversal begins. Definition at line 36 of file cullTraverser.I. References CullTraverser::_scene_setup, and INLINE. |
|
Specifies the bounding volume that corresponds to the view frustum. Any primitives that fall entirely outside of this volume are not drawn. Definition at line 216 of file cullTraverser.I. References CullTraverser::_cull_handler, and INLINE. |
|
Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space.
Definition at line 109 of file cullTraverser.cxx. References NULL. |
|
Begins the traversal from the indicated node.
Definition at line 86 of file cullTraverser.cxx. References CullTraverser::_camera_mask, CullTraverserData::apply_transform_and_state(), PandaNode::get_effects(), RenderEffects::has_show_bounds(), CullTraverserData::is_in_view(), CullTraverserData::node(), and CullTraverser::show_bounds(). Referenced by CollisionNode::combine_with(). |
|
Traverses all the children of the indicated node, with the given data, which been converted into the node's space.
Definition at line 159 of file cullTraverser.cxx. Referenced by PGTop::has_cull_callback(). |
|
Definition at line 52 of file pgCullTraverser.h. Referenced by PGItem::has_cull_callback(). |
|
Definition at line 51 of file pgCullTraverser.h. |
|
Reimplemented from CullTraverser. Definition at line 24 of file pgCullTraverser.cxx. |