Managing Scenes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
UpandComing
Posts: 5
Joined: Tue Dec 06, 2011 3:12 pm

Managing Scenes

Post by UpandComing »

Okay, so I'm having a little difficulty getting my head around managing scene nodes. I get that to be displayed scene nodes have to be children of an active ISceneManager, but what about when changing scene, for example from a main menu to starting the game, if all the menu nodes are stored under the active scene manager does a new ISceneManager have to be created for the other levels?
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Managing Scenes

Post by greenya »

You do next:
SceneManager
|--- MenuSceneNode --- ... menu structure
|--- LevelSceneNode --- ... level structure

Then you can use it like layers and change visibility of all the menu or game level.
For new levels you can delete children of LevelSceneNode and fill it with new level data.

(*) where MenuSceneNode and LevelSceneNode are an empty scene nodes created via addEmptySceneNode().

P.S.: i suppose your menu made of SceneNodes (but in general menu is drawn (as all the GUI) using IGUIEnvironment, which is similar to SceneManager, but used or UI).
UpandComing
Posts: 5
Joined: Tue Dec 06, 2011 3:12 pm

Re: Managing Scenes

Post by UpandComing »

So you don't ever change ISceneManagers but change the level of visibility of each scene node?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Managing Scenes

Post by randomMesh »

I'd use a state machine.
"Whoops..."
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Managing Scenes

Post by greenya »

UpandComing wrote:So you don't ever change ISceneManagers but change the level of visibility of each scene node?
Its up to you.
If you want new distinct SceneManager, you can create it via createNewSceneManager().
So the answer on your question:
does a new ISceneManager have to be created for the other levels?
No. You can clear all the nodes via clear().
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Managing Scenes

Post by Brainsaw »

I also prefer a statemachine, and when a state is deactivated it clears the scenemanager, and on activation it loads it's scene. From time to time I need a second scenemanager for level preview.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Post Reply