mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
add get_sort()
This commit is contained in:
parent
a4129aa412
commit
89659d9e78
@ -168,6 +168,29 @@ get_stashed_children() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: NodePath::get_sort
|
||||
// Access: Published
|
||||
// Description: Returns the sort value of the referenced node within
|
||||
// its parent; that is, the sort number passed on the
|
||||
// last reparenting operation for this node. This will
|
||||
// control the position of the node within its parent's
|
||||
// list of children.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
int NodePath::
|
||||
get_sort() const {
|
||||
if (!has_parent()) {
|
||||
return 0;
|
||||
}
|
||||
PandaNode *parent = _head->get_next()->get_node();
|
||||
PandaNode *child = node();
|
||||
nassertr(parent != (PandaNode *)NULL && child != (PandaNode *)NULL, 0);
|
||||
int child_index = parent->find_child(child);
|
||||
nassertr(child_index != -1, 0);
|
||||
|
||||
return parent->get_child_sort(child_index);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: NodePath::find
|
||||
// Access: Published
|
||||
|
@ -186,6 +186,7 @@ PUBLISHED:
|
||||
|
||||
INLINE bool has_parent() const;
|
||||
INLINE NodePath get_parent() const;
|
||||
int get_sort() const;
|
||||
|
||||
NodePath find(const string &path) const;
|
||||
NodePath find_path_to(PandaNode *node) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user