Character and Terrain and some other things

mujtaba

23-03-2008 18:57:27

Hey there Betajaen [And thanks very much for the last time :) ]

Well, I need to deliver another little project. And I need to get Terrain , Character Controller to work and to do some queries and stop simulation

From what I read, to get these things to work, I should use the version 0.9 of NxOgre. Can you give me directions on how to implement an NxOgre basecode [Is that possible with a few changes to the AppWizard ?] that is capable of doing these ? [from what I have tried, I did get the first version on Cake to work, but I need to change the Scene manager to load the terrain and the cake code - well I think I can do something about this]

And how should I stop the Simulation ? Also, is it better to use OGRE to do scene queries or is NxOgre better to be used in this case ?

Sorry if I ask too much question and BTW, right now the Shortguide is down... [Before I could give it a proper read I must add :( ]

betajaen

23-03-2008 19:28:21

It isn't to hard to implement NxOgre in any Ogre application that isn't cake.
First you need to store the World and Scene pointers; usually where you would store your Root and SceneManager pointers as well.

Create your World after Root is created.

mWorld = new World(...);

Then once your SceneManager is created, then you can create your Scene.

mScene = mWorld->createScene(...);

Load in your terrain, then you can create the terrain Actor.

When your ready to close down. Just mirror the creation order. Delete mScene before you delete mSceneMgr and delete World before you delete Root.

mWorld->destroyScene(mScene);

delete mWorld;


Once you get over the initial hump, you'll see how easy it is.


As for scene queries; I believe it's faster to use NxOgre.

mujtaba

23-03-2008 20:29:29

Thanks, I just got NxOgre to work, from this point on, it should be pretty easy :D

mujtaba

04-04-2008 13:59:13

I am trying to attach this object to a character : http://www.ogre3d.org/wiki/index.php/MovableText
I should attach it to a scene node as it is described there. I tried to attach it using the mCharacter->attachObject( movableText ). I tried to attach it using the mCharacter->getEntity()->getParentSceneNode(), neither worked. But using SceneMgr()->getRootSceneNode()->createChildSceneNode() worked.
So, is there a way, or should I use this method and update the position before every frame ??