multiple scenemanagers
multiple scenemanagers
Hi!
my problem is that i want split a screen and display two different scenes in it. means that on the one side is another scene then on the other side.
is it possible to use two scenemanagers in ogre?
or could i use another resolution for this?
multiple viewports like in the splitscreendemo will not work because there will the same scene displayed in the viewports.
hope someone could give me a answer or could me a little bit.
my problem is that i want split a screen and display two different scenes in it. means that on the one side is another scene then on the other side.
is it possible to use two scenemanagers in ogre?
or could i use another resolution for this?
multiple viewports like in the splitscreendemo will not work because there will the same scene displayed in the viewports.
hope someone could give me a answer or could me a little bit.
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
could you help me a little bit more.
i tried it with the following code:
and in renderloop
but the problem is that the smgr and smgr2 are two pointers to the same scene.
have i misunderstand it?
i tried it with the following code:
Code: Select all
smgr = device->getSceneManger();
smgr2 = device->getSceneManager();
Code: Select all
...
smgr->getRootScene()->setVisible(false);
smgr2->getRootScene()->setVisible(false);
...
have i misunderstand it?
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
You would use the same scene manager for both scenes:
but have your two 'scenes' attached to it:
And then instead of creating your scene nodes with parent 0, pass them scene1 or scene2 as the parent:
Then to render:
In essence, do everything you would normally do to set up your scenes, but be sure to use ISceneNode scene1 or scene2 as the root parent rather then the default scene manager root node. Hope thats clear enough, if not, ask away
Code: Select all
smgr = device->getSceneManger();
Code: Select all
ISceneNode scene1 = smgr->addEmptySceneNode();
ISceneNode scene2 = smgr->addEmptySceneNode();
Code: Select all
ISceneNode scene1_Level = smgr->addOctTreeSceneNode(Level1Mesh, scene1);
ISceneNode scene2_Level = smgr->addOctTreeSceneNode(Level2Mesh, scene2);
Code: Select all
//before drawing scene1
scene1.setVisible(true);
scene2.setVisible(false);
//set up view port 1, and draw scene
// ... viewport code
smgr.drawAll();
//before drawing scene2
scene1.setVisible(false);
scene2.setVisible(true);
//set up view port 2, and draw scene
// ... viewport code
smgr.drawAll();
Indeed if you "get" the scene manager. You'll get a pointer. So no matter how much you do that it will always point to the same thing.
A pointer value has a * when declaring it.
Like: ISceneNode *blah;
ISceneNode is astract so it has to be a pointer.
Also, you only need 1 scenenode if it's both on the same level (that's what you want right?).
Just another camera position for the other camera.
Having the same level in your memory twice is not needed;
If you want another node for the same level you can always do:
This message might be a bit off topic.. srry.
- Myth
A pointer value has a * when declaring it.
Like: ISceneNode *blah;
ISceneNode is astract so it has to be a pointer.
Also, you only need 1 scenenode if it's both on the same level (that's what you want right?).
Just another camera position for the other camera.
Having the same level in your memory twice is not needed;
Code: Select all
ISceneNode *node = smgr->addOctTreeSceneNode(LevelMesh, scene1);
Code: Select all
ISceneNode *controller2 = controller1;
- Myth
JOIN MY (100mbs 2x 3GHZ CPU) IRRLICHT FORUMS
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.
My fan site: http://www.halo-center.com
http://irrlicht.halo4you.com/forums/
For all your programming quesitons and irrlicht ones!.
My fan site: http://www.halo-center.com