Hello, I'm loading my IRRScene File which got many childrens at one parent-node. I just know the name of the Parent node and want to get one Child Node out of the children list, but I don't know how I could do this. I just know the typeName of the ChildNode.
Thanks for help
Get ChildNode of IRRScene Node
-
randomMesh
- Posts: 1187
- Joined: Fri Dec 29, 2006 12:04 am
Re: Get ChildNode of IRRScene Node
You could do something like this
or even better:
Code: Select all
// find all nodes
irr::core::array<irr::scene::ISceneNode*> nodes;
sceneManager->getSceneNodesFromType(irr::scene::ESNT_ANY, nodes);
const irr::u32 numNodes = nodes.size();
for (irr::u32 n = 0; n < numNodes; ++n)
{
irr::scene::ISceneNode* const node = nodes[n];
const irr::scene::ESCENE_NODE_TYPE& type = node->getType();
const irr::s32 id = node->getID();
const irr::c8* name = node->getName();
//check type, id and name of node and do something with it
}
Code: Select all
irr::scene::ISceneNode* parentNode = sceneManager->getSceneNodeFromName("parentNodesName");
irr::core::list<irr::scene::ISceneNode*> children = parentNode->getChildren();
irr::core::list<irr::scene::ISceneNode*>::ConstIterator start = children.begin();
const irr::core::list<irr::scene::ISceneNode*>::ConstIterator& end = children.end();
for (; start != end; ++start)
{
irr::scene::ISceneNode* const node = (*start);
const irr::scene::ESCENE_NODE_TYPE& type = node->getType();
const irr::s32 id = node->getID();
const irr::c8* name = node->getName();
}
"Whoops..."