Panda3D
Loading...
Searching...
No Matches
CullTraverserData Class Reference

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 CullTraverserData &parent, PandaNode *child)
 This constructor creates a CullTraverserData object that reflects the next node down in the traversal.
 
 CullTraverserData (const NodePath &start, const TransformState *net_transform, const RenderState *state, GeometricBoundingVolume *view_frustum, Thread *current_thread)
 
void apply_transform (const TransformState *node_transform)
 Applies the indicated transform changes onto the current data.
 
void apply_transform_and_state (CullTraverser *trav)
 Applies the transform and state from the current node onto the current data.
 
ConstPointerTo< TransformStateget_internal_transform (const CullTraverser *trav) const
 
ConstPointerTo< TransformStateget_modelview_transform (const CullTraverser *trav) const
 
const TransformStateget_net_transform (const CullTraverser *trav) const
 
NodePath get_node_path () const
 
bool is_in_view (const DrawMask &camera_mask)
 
bool is_this_node_hidden (const DrawMask &camera_mask) 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.
 
PandaNodenode () const
 Returns the node traversed to so far.
 
PandaNodePipelineReadernode_reader ()
 Returns the PipelineReader for the node traversed to so far.
 
const PandaNodePipelineReadernode_reader () const
 Returns the PipelineReader for the node traversed to so far.
 

Public Attributes

ConstPointerTo< CullPlanes_cull_planes
 
DrawMask _draw_mask
 
ConstPointerTo< TransformState_net_transform
 
PandaNodePipelineReader _node_reader
 
int _portal_depth
 
ConstPointerTo< RenderState_state
 
PointerTo< GeometricBoundingVolume_view_frustum
 
 get_node_path
 Constructs and returns an actual NodePath that represents the same path we have just traversed.
 

Detailed Description

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 40 of file cullTraverserData.h.

Constructor & Destructor Documentation

◆ CullTraverserData() [1/2]

CullTraverserData::CullTraverserData ( const NodePath & start,
const TransformState * net_transform,
const RenderState * state,
GeometricBoundingVolume * view_frustum,
Thread * current_thread )
inline

Definition at line 17 of file cullTraverserData.I.

◆ CullTraverserData() [2/2]

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 42 of file cullTraverserData.I.

Member Function Documentation

◆ apply_transform()

void CullTraverserData::apply_transform ( const TransformState * node_transform)

Applies the indicated transform changes onto the current data.

Definition at line 77 of file cullTraverserData.cxx.

References TransformState::is_identity(), TransformState::is_singular(), and CullPlanes::make_empty().

Referenced by apply_transform_and_state().

◆ apply_transform_and_state()

void CullTraverserData::apply_transform_and_state ( CullTraverser * trav)

◆ is_this_node_hidden()

bool CullTraverserData::is_this_node_hidden ( const DrawMask & camera_mask) 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 159 of file cullTraverserData.I.

◆ node()

PandaNode * CullTraverserData::node ( ) const
inline

Returns the node traversed to so far.

Definition at line 65 of file cullTraverserData.I.

◆ node_reader() [1/2]

PandaNodePipelineReader * CullTraverserData::node_reader ( )
inline

Returns the PipelineReader for the node traversed to so far.

Definition at line 73 of file cullTraverserData.I.

◆ node_reader() [2/2]

const PandaNodePipelineReader * CullTraverserData::node_reader ( ) const
inline

Returns the PipelineReader for the node traversed to so far.

Definition at line 81 of file cullTraverserData.I.

Member Data Documentation

◆ _cull_planes

ConstPointerTo< CullPlanes > CullTraverserData::_cull_planes

Definition at line 83 of file cullTraverserData.h.

◆ _draw_mask

DrawMask CullTraverserData::_draw_mask

Definition at line 84 of file cullTraverserData.h.

◆ _net_transform

ConstPointerTo< TransformState > CullTraverserData::_net_transform

Definition at line 80 of file cullTraverserData.h.

◆ _node_reader

PandaNodePipelineReader CullTraverserData::_node_reader

Definition at line 79 of file cullTraverserData.h.

◆ _portal_depth

int CullTraverserData::_portal_depth

Definition at line 85 of file cullTraverserData.h.

◆ _state

ConstPointerTo< RenderState > CullTraverserData::_state

Definition at line 81 of file cullTraverserData.h.

◆ _view_frustum

PointerTo< GeometricBoundingVolume > CullTraverserData::_view_frustum

Definition at line 82 of file cullTraverserData.h.

◆ get_node_path

NodePath CullTraverserData::get_node_path
inline

Constructs and returns an actual NodePath that represents the same path we have just traversed.

Definition at line 70 of file cullTraverserData.h.


The documentation for this class was generated from the following files: