CullTraverserData

class CullTraverserData

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).

Inheritance diagram

Inheritance diagram of CullTraverserData

CullTraverserData(CullTraverserData const&) = default

This constructor creates a CullTraverserData object that reflects the next node down in the traversal.

This constructor creates a CullTraverserData object that reflects the next node down in the traversal.

bool apply_cull_planes(CullPlanes const *planes, GeometricBoundingVolume const *node_gbv)

Applies the cull planes. Returns true if the node should still be rendered, false if it should be culled.

void apply_transform(TransformState const *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. This also evaluates billboards, etc.

ConstPointerTo<TransformState> get_internal_transform(CullTraverser const *trav) const

Returns the internal transform: the modelview transform in the GSG’s internal coordinate system.

ConstPointerTo<TransformState> get_modelview_transform(CullTraverser const *trav) const

Returns the modelview transform: the relative transform from the camera to the model.

TransformState const *get_net_transform(CullTraverser const *trav) const

Returns the net transform: the relative transform from root of the scene graph to the current node.

int is_in_view(DrawMask const &camera_mask) const

Returns intersection flags if the current node may be within the view frustum, 0 otherwise.

bool is_this_node_hidden(DrawMask const &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. If this returns true, the node should not be rendered.

PandaNode *node(void) const

Returns the node traversed to so far.