mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
returning node descendant by name
This commit is contained in:
@@ -422,6 +422,21 @@ namespace vb01{
|
||||
return origin;
|
||||
}
|
||||
|
||||
Node* Node::findDescendant(string name, bool allDescendants){
|
||||
vector<Node*> descendants = children;
|
||||
|
||||
if(allDescendants){
|
||||
descendants.clear();
|
||||
getDescendants(descendants);
|
||||
}
|
||||
|
||||
for(Node *desc : descendants)
|
||||
if(desc->getName() == name)
|
||||
return desc;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Node::updateShaders(){
|
||||
Root *root = Root::getSingleton();
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace vb01{
|
||||
Quaternion globalToLocalOrientation(Quaternion);
|
||||
Vector3 localToGlobalScale(Vector3);
|
||||
Vector3 globalToLocalScale(Vector3);
|
||||
Node* findDescendant(std::string, bool=false);
|
||||
inline void dettachMesh(int id){meshes.erase(meshes.begin() + id);}
|
||||
inline Skeleton* getSkeleton(int i){return skeletons[i];}
|
||||
inline int getNumSkeletons(){return skeletons.size();}
|
||||
|
||||
Reference in New Issue
Block a user