I do a specific draw order of scene nodes, so instead of calling drawALL() I manually call render() on every node I need in the order I need. So far I've been working with single mesh nodes and it worked well. However this doesn't work with a COLLADA scene. I can't find how to call render() on a COLLADA scene.
When I create the scene node smgr->addMeshSceneNode(world1_mesh) returns a dummy node that doesn't seem to have any children. Calling render on the dummy node itself doesn't render the scene. If I do smgr->drawAll() it draws the scene, but since I can't do that what do I do?
How to render a COLLADA scene
Re: How to render a COLLADA scene
Uhm, yeah - loading them is a little strange because it's just a hack on top of the meshloader (instead of having sceneloader interface for that - pure historical reasons).
First you have to set smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
That ensures you get scenes. But I guess you did that already.
The node returned seems to be a dummy. The real scene is just added to the scenemanager - so all nodes are children below the root of the scenemanager. If you do not want to overwrite the current scene you can create a new scenemanager (ISceneManager::createNewSceneManager) and load it into that one. You can move nodes between scenemanagers (with node->setParent), so you can move all children nodes of the new scenemanager to the original one after loading.
First you have to set smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
That ensures you get scenes. But I guess you did that already.
The node returned seems to be a dummy. The real scene is just added to the scenemanager - so all nodes are children below the root of the scenemanager. If you do not want to overwrite the current scene you can create a new scenemanager (ISceneManager::createNewSceneManager) and load it into that one. You can move nodes between scenemanagers (with node->setParent), so you can move all children nodes of the new scenemanager to the original one after loading.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm