#include <cullTraverser.h>
Inheritance diagram for CullTraverser:
Public Member Functions | |
CullTraverser () | |
CullTraverser (const CullTraverser ©) | |
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. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
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. | |
Private Member Functions | |
void | show_bounds (CullTraverserData &data) |
Draws an appropriate visualization of the node's external bounding volume. | |
PointerTo< Geom > | make_bounds_viz (const BoundingVolume &vol) |
Returns an appropriate visualization of the indicated bounding volume. | |
ConstPointerTo< RenderState > | get_bounds_outer_viz_state () |
Returns a RenderState for rendering the outside surfaces of the bounding volume visualizations. | |
ConstPointerTo< RenderState > | get_bounds_inner_viz_state () |
Returns a RenderState for rendering the inside surfaces of the bounding volume visualizations. | |
ConstPointerTo< RenderState > | get_depth_offset_state () |
Returns a RenderState for increasing the DepthOffset by one. | |
void | start_decal (const CullTraverserData &data) |
Collects a base node and all of the decals applied to it. | |
CullableObject * | r_get_decals (CullTraverserData &data, CullableObject *decals) |
Recursively gets all the decals applied to a particular GeomNode. | |
Private Attributes | |
PointerTo< SceneSetup > | _scene_setup |
DrawMask | _camera_mask |
ConstPointerTo< RenderState > | _initial_state |
bool | _depth_offset_decals |
PointerTo< GeometricBoundingVolume > | _view_frustum |
PointerTo< GeometricBoundingVolume > | _guard_band |
CullHandler * | _cull_handler |
Static Private Attributes | |
TypeHandle | _type_handle |
Each renderable Geom encountered is passed along with its associated RenderState to the CullHandler object.
Definition at line 57 of file cullTraverser.h.
|
Definition at line 50 of file cullTraverser.cxx. |
|
Definition at line 66 of file cullTraverser.cxx. |
|
Implements TypedObject. Reimplemented in PGCullTraverser. Definition at line 120 of file cullTraverser.h. |
|
Returns a RenderState for rendering the inside surfaces of the bounding volume visualizations.
Definition at line 316 of file cullTraverser.cxx. References PandaNode::get_children(), PandaNode::get_first_visible_child(), PandaNode::has_selective_visibility(), PandaNode::is_geom_node(), CullTraverserData::node(), and NULL. |
|
Returns a RenderState for rendering the outside surfaces of the bounding volume visualizations.
Definition at line 292 of file cullTraverser.cxx. References CPT, DepthOffsetAttrib::make(), RenderState::make(), and NULL. |
|
Returns the visibility mask from the camera viewing the scene.
Definition at line 199 of file cullTraverser.I. References _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 _scene_setup, and INLINE. Referenced by LODNode::xform(). |
|
Reimplemented from TypedObject. Reimplemented in PGCullTraverser. Definition at line 109 of file cullTraverser.h. Referenced by PGCullTraverser::get_class_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 _view_frustum, and INLINE. |
|
Returns a RenderState for increasing the DepthOffset by one.
Definition at line 340 of file cullTraverser.cxx. |
|
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 _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 _depth_offset_decals, and INLINE. |
|
Returns the SceneSetup object.
Definition at line 49 of file cullTraverser.I. References _scene_setup, and INLINE. |
|
Implements TypedObject. Reimplemented in PGCullTraverser. Definition at line 117 of file cullTraverser.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 TypedObject. Reimplemented in PGCullTraverser. Definition at line 112 of file cullTraverser.h. Referenced by PGCullTraverser::get_class_type(). |
|
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(). |
|
|
Returns an appropriate visualization of the indicated bounding volume.
Definition at line 255 of file cullTraverser.cxx. References Colorf, CPT, CullFaceAttrib::M_cull_clockwise, RenderModeAttrib::M_wireframe, CullFaceAttrib::make(), RenderModeAttrib::make(), RenderState::make(), ColorAttrib::make_flat(), and NULL. |
|
Recursively gets all the decals applied to a particular GeomNode. These are built into a CullableObject list in LIFO order (so that the traversing the list will extract them in the order they were encountered in the scene graph). Definition at line 435 of file cullTraverser.cxx. |
|
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 _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 _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 _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 _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 _cull_handler, and INLINE. |
|
Draws an appropriate visualization of the node's external bounding volume.
Definition at line 227 of file cullTraverser.cxx. Referenced by traverse(). |
|
Collects a base node and all of the decals applied to it. This involves recursing below the base GeomNode to find all the decal geoms. Definition at line 365 of file cullTraverser.cxx. References _cull_handler. |
|
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 _camera_mask, CullTraverserData::apply_transform_and_state(), PandaNode::get_effects(), RenderEffects::has_show_bounds(), CullTraverserData::is_in_view(), CullTraverserData::node(), and 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 101 of file cullTraverser.h. Referenced by get_initial_state(), and traverse(). |
|
Definition at line 106 of file cullTraverser.h. Referenced by set_view_frustum(), and start_decal(). |
|
Definition at line 103 of file cullTraverser.h. Referenced by get_render_transform(), and set_initial_state(). |
|
Definition at line 105 of file cullTraverser.h. Referenced by get_camera_mask(), and set_camera_mask(). |
|
Definition at line 102 of file cullTraverser.h. |
|
Definition at line 100 of file cullTraverser.h. Referenced by get_camera_transform(), get_scene(), and set_scene(). |
|
Reimplemented from TypedObject. Reimplemented in PGCullTraverser. Definition at line 39 of file cullTraverser.cxx. |
|
Definition at line 104 of file cullTraverser.h. Referenced by get_depth_offset_decals(), and set_depth_offset_decals(). |