Panda3D
Public Attributes | List of all members
WorkingNodePath Class Reference

This is a class designed to support low-overhead traversals of the complete scene graph, with a memory of the complete path through the graph at any given point. More...

Public Attributes

NodePath node_path
 Constructs and returns an actual NodePath that represents the same path we have just traversed. More...
 
bool valid
 Returns true if the WorkingNodePath object appears to be a valid NodePath reference, false otherwise. More...
 

Detailed Description

This is a class designed to support low-overhead traversals of the complete scene graph, with a memory of the complete path through the graph at any given point.

You could just use a regular NodePath to do this, but since the NodePath requires storing NodePathComponents on each node as it is constructed, and then removing them when it destructs, there is considerable overhead in that approach.

The WorkingNodePath eliminates this overhead (but does not guarantee consistency if the scene graph changes while the path is held).

At any given point, you may ask the WorkingNodePath for its actual NodePath, and it will construct and return a new NodePath representing the complete generated chain.

Member Data Documentation

◆ node_path

NodePath node_path

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

◆ valid

bool valid

Returns true if the WorkingNodePath object appears to be a valid NodePath reference, false otherwise.