Panda3D
|
This collects together the pieces of data that are accumulated for each node while walking the scene graph during the cull traversal. More...
#include "cullTraverserData.h"
Public Member Functions | |
CullTraverserData (const NodePath &start, const TransformState *net_transform, const RenderState *state, GeometricBoundingVolume *view_frustum, Thread *current_thread) | |
CullTraverserData (const CullTraverserData ©) | |
CullTraverserData (const CullTraverserData &parent, PandaNode *child) | |
This constructor creates a CullTraverserData object that reflects the next node down in the traversal. | |
void | apply_transform_and_state (CullTraverser *trav) |
Applies the transform and state from the current node onto the current data. | |
void | apply_transform_and_state (CullTraverser *trav, CPT(TransformState) node_transform, CPT(RenderState) node_state, CPT(RenderEffects) node_effects, const RenderAttrib *off_clip_planes) |
Applies the indicated transform and state changes (e.g. | |
CPT (TransformState) get_modelview_transform(const CullTraverser *trav) const | |
CPT (TransformState) _net_transform | |
CPT (RenderState) _state | |
CPT (CullPlanes) _cull_planes | |
const TransformState * | get_net_transform (const CullTraverser *trav) const |
Returns the net transform: the relative transform from root of the scene graph to the current node. | |
bool | is_in_view (const DrawMask &camera_mask) |
Returns true if the current node is within the view frustum, false otherwise. | |
bool | is_this_node_hidden (const CullTraverser *trav) const |
Returns true if this particular node is hidden, even though we might be traversing past this node to find a child node that has had show_through() called for it. | |
PandaNode * | node () const |
Returns the node traversed to so far. | |
PandaNodePipelineReader * | node_reader () |
Returns the PipelineReader for the node traversed to so far. | |
const PandaNodePipelineReader * | node_reader () const |
Returns the PipelineReader for the node traversed to so far. | |
void | operator= (const CullTraverserData ©) |
PT (GeometricBoundingVolume) _view_frustum | |
Public Attributes | |
DrawMask | _draw_mask |
WorkingNodePath | _node_path |
PandaNodePipelineReader | _node_reader |
int | _portal_depth |
This collects together the pieces of data that are accumulated for each node while walking the scene graph during the cull traversal.
Having this as a separate object simplifies the parameter list to CullTraverser::r_traverse(), as well as to other functions like PandaNode::cull_callback(). It also makes it easier to add cull parameters, and provides a place to abstract out some of the cull behavior (like view-frustum culling).
Definition at line 45 of file cullTraverserData.h.
CullTraverserData::CullTraverserData | ( | const CullTraverserData & | parent, |
PandaNode * | child | ||
) | [inline] |
This constructor creates a CullTraverserData object that reflects the next node down in the traversal.
Definition at line 80 of file cullTraverserData.I.
References PandaNodePipelineReader::check_bounds().
void CullTraverserData::apply_transform_and_state | ( | CullTraverser * | trav | ) |
Applies the transform and state from the current node onto the current data.
This also evaluates billboards, etc.
Definition at line 49 of file cullTraverserData.cxx.
References PandaNodePipelineReader::compose_draw_mask(), SceneSetup::get_camera_node(), PandaNodePipelineReader::get_effects(), CullTraverser::get_scene(), PandaNodePipelineReader::get_state(), PandaNodePipelineReader::get_tag(), CullTraverser::get_tag_state_key(), PandaNodePipelineReader::get_transform(), PandaNodePipelineReader::has_tag(), and CullTraverser::has_tag_state_key().
Referenced by LODNode::show_switches_cull_callback(), and CullTraverser::traverse().
void CullTraverserData::apply_transform_and_state | ( | CullTraverser * | trav, |
CPT(TransformState) | node_transform, | ||
CPT(RenderState) | node_state, | ||
CPT(RenderEffects) | node_effects, | ||
const RenderAttrib * | off_clip_planes | ||
) |
Applies the indicated transform and state changes (e.g.
as extracted from a node) onto the current data. This also evaluates billboards, etc.
Definition at line 76 of file cullTraverserData.cxx.
References RenderEffects::cull_callback(), RenderState::get_attrib(), RenderEffects::get_effect(), RenderEffects::has_cull_callback(), TransformState::is_identity(), and TransformState::is_singular().
const TransformState * CullTraverserData::get_net_transform | ( | const CullTraverser * | trav | ) | const [inline] |
Returns the net transform: the relative transform from root of the scene graph to the current node.
Definition at line 141 of file cullTraverserData.I.
Referenced by CallbackNode::add_for_draw(), GeomNode::add_for_draw(), LODNode::compute_child(), OccluderNode::cull_callback(), PlaneNode::cull_callback(), PGItem::cull_callback(), CompassEffect::cull_callback(), PipeOcclusionCullTraverser::is_in_view(), and NodeCullCallbackData::upcall().
bool CullTraverserData::is_in_view | ( | const DrawMask & | camera_mask | ) | [inline] |
Returns true if the current node is within the view frustum, false otherwise.
If the node's bounding volume falls completely within the view frustum, this will also reset the view frustum pointer, saving some work for future nodes.
Definition at line 155 of file cullTraverserData.I.
References PandaNodePipelineReader::compare_draw_mask(), PandaNodePipelineReader::get_transform(), and TransformState::is_invalid().
Referenced by CullTraverser::is_in_view().
bool CullTraverserData::is_this_node_hidden | ( | const CullTraverser * | trav | ) | const [inline] |
Returns true if this particular node is hidden, even though we might be traversing past this node to find a child node that has had show_through() called for it.
If this returns true, the node should not be rendered.
Definition at line 188 of file cullTraverserData.I.
References CullTraverser::get_camera_mask(), and PandaNode::get_overall_bit().
Referenced by PGItem::cull_callback(), and CullTraverser::traverse_below().
PandaNode * CullTraverserData::node | ( | ) | const [inline] |
Returns the node traversed to so far.
Definition at line 108 of file cullTraverserData.I.
References WorkingNodePath::node().
Referenced by CharacterJointEffect::cull_callback(), CompassEffect::cull_callback(), PipeOcclusionCullTraverser::is_in_view(), CullTraverser::traverse(), CullTraverser::traverse_below(), and NodeCullCallbackData::upcall().
PandaNodePipelineReader * CullTraverserData::node_reader | ( | ) | [inline] |
Returns the PipelineReader for the node traversed to so far.
Definition at line 119 of file cullTraverserData.I.
Referenced by PipeOcclusionCullTraverser::is_in_view(), CullTraverser::traverse(), and CullTraverser::traverse_below().
const PandaNodePipelineReader * CullTraverserData::node_reader | ( | ) | const [inline] |
Returns the PipelineReader for the node traversed to so far.
Definition at line 130 of file cullTraverserData.I.