Managing Scenes
-
- Posts: 5
- Joined: Tue Dec 06, 2011 3:12 pm
Managing Scenes
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?
Re: Managing Scenes
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).
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).
-
- Posts: 5
- Joined: Tue Dec 06, 2011 3:12 pm
Re: Managing Scenes
So you don't ever change ISceneManagers but change the level of visibility of each scene node?
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
Re: Managing Scenes
Its up to you.UpandComing wrote:So you don't ever change ISceneManagers but change the level of visibility of each scene node?
If you want new distinct SceneManager, you can create it via createNewSceneManager().
So the answer on your question:
No. You can clear all the nodes via clear().does a new ISceneManager have to be created for the other levels?
Re: Managing Scenes
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
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames