Hello. I am trying load scene from *.irr file with loadScene() method. When not set a root node - all good, but with root node (for example EmptySceneNode) - fail. Viewport is empty. Help me please.
//! Gets the root scene node.
/** This is the scene node which is parent
of all scene nodes. The root scene node is a special scene node which
only exists to manage all scene nodes. It will not be rendered and cannot
be removed from the scene.
\return Pointer to the root scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* getRootSceneNode() = 0;
also, if you truly have independent scenes that you want to make visible / not visible (thereby only rendering the scenenodes in that scene), you might want to create a new scenemanager for each of your scenes
example :
the main smgr is the default irrlicht smgr, it is auto created when irrlicht device is created
ISceneManager* mainSmgr = getDevice()->getSceneManager();
in each of your independent scenes, use the main smgr to create individual smgrs
ISceneManager* anotherSmgr = mainSmgr->createNewSceneManager();
in the manager, simply decide which smgr you want to render.
switch (game_state)
{
case INTRO : getIntroScene()->getSmgr()->draw(); break;
case MENU : getMenuScene()->getSmgr()->draw(); break;
case GAME : getGameScene()->getSmgr()->draw(); break;
}
If you want it to draw together then use a single scenemanager. Thought in theory you can also draw one after the other (calling drawAll from each one), but this will change the order of drawing Irrlicht usually uses and should only be done if you know what you do. For example if transparent things are drawn suddenly before solid objects the transparency will no longer work. Basically the main reason for different scenemanagers is to keep scenes completely independent (not drawing at the same time), or sometimes to ensure some stuff is drawn on top of each other (as you have control over the order of rendering when using more than one scenemanager).