mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
add find_child
This commit is contained in:
parent
06808bf5f2
commit
c37f62fd9a
@ -289,6 +289,25 @@ steal_children(EggGroupNode &other) {
|
||||
_children.splice(_children.end(), other._children);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggGroupNode::find_child
|
||||
// Access: Public
|
||||
// Description: Returns the child of this node whose name is the
|
||||
// indicated string, or NULL if there is no child of
|
||||
// this node by that name. Does not search recursively.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
EggNode *EggGroupNode::
|
||||
find_child(const string &name) const {
|
||||
Children::const_iterator ci;
|
||||
for (ci = _children.begin(); ci != _children.end(); ++ci) {
|
||||
EggNode *child = (*ci);
|
||||
if (child->get_name() == name) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggGroupNode::resolve_filenames
|
||||
|
@ -109,6 +109,8 @@ public:
|
||||
PT(EggNode) remove_child(PT(EggNode) node);
|
||||
void steal_children(EggGroupNode &other);
|
||||
|
||||
EggNode *find_child(const string &name) const;
|
||||
|
||||
void resolve_filenames(const DSearchPath &searchpath);
|
||||
void reverse_vertex_ordering();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user