pgraph: Allow moving a NodePath into a WorkingNodePath efficiently

This commit is contained in:
rdb 2022-10-22 17:03:30 +02:00
parent 4d2a13537a
commit a44d26bfbf
2 changed files with 15 additions and 1 deletions

View File

@ -21,7 +21,20 @@ WorkingNodePath(const NodePath &start) {
nassertv(!start.is_empty());
_next = nullptr;
_start = start._head;
_node = start.node();
_node = _start->get_node();
}
/**
* Creates a WorkingNodePath that is the same as the indicated NodePath. This
* is generally used to begin the traversal of a scene graph with the root
* NodePath.
*/
INLINE WorkingNodePath::
WorkingNodePath(NodePath &&start) {
nassertv(!start.is_empty());
_next = nullptr;
_start = std::move(start._head);
_node = _start->get_node();
}
/**

View File

@ -39,6 +39,7 @@
class EXPCL_PANDA_PGRAPH WorkingNodePath {
public:
INLINE WorkingNodePath(const NodePath &start);
INLINE WorkingNodePath(NodePath &&start);
INLINE WorkingNodePath(const WorkingNodePath &copy);
INLINE WorkingNodePath(const WorkingNodePath &parent, PandaNode *child);
INLINE ~WorkingNodePath();