NxOgre Root?

JoshPendergrass

01-08-2007 20:43:04

Hi, I'm trying to use NxOgre with out a sandbox.
Assuming Ogre is all set up with Root, Scene, Window, Render and so on.
What would be need for NxOgre?
such as:


mWorld = new NxOgre::World("log: html");
mScene = mWorld->createScene("Main", m_pOgre->sceneMgr, "gravity: yes, floor: yes");


Hope there is an easy answer to this..

I've tried to dissect Cake but it's kinda hard to figure what is extra and what is actually needed.

betajaen

01-08-2007 21:41:35

That's it.

Just store mWorld and mScene somewhere and your good to go.

JoshPendergrass

02-08-2007 08:34:33

Thanks for the fast response.
Any idea why a Body or Actor won't appear but an Entity will?


NxOgre::Body *body = mScene->createBody("Player", new NxOgre::TriangleMeshShape("robot.mesh", "mesh-scale: 1.0 1.0 1.0"), Ogre::Vector3(0, 0.0f, 0), "node-scale: 1.0 1.0 1.0, mass: 100000");

betajaen

02-08-2007 08:59:48

NxOgre::Body *body = mScene->createBody("robot.mesh", new NxOgre::TriangleMeshShape("robot.mesh", "mesh-scale: 1.0 1.0 1.0"), Ogre::Vector3(0, 0.0f, 0), "node-scale: 1.0 1.0 1.0, mass: 100000");

You haven't told createBody you want an entity shown (it's the first argument).

But don't TriangleMeshShapes like that, they don't behave well at all when they are not static. Use a Convex or a Compound of Shapes instead.

JoshPendergrass

02-08-2007 09:26:17

Can't believe I missed that... Thanks a ton it's much appreciated =)

betajaen

02-08-2007 10:42:33

No worries, but here somethings to keep in mind:

- With Actors the first argument is the name of the Actor.

- Bodies are Actors with a SceneNode, Actors have no SceneNode. So in a sense they are invisible.

- The first argument of a Body is the name of the Body; Unless it ends with ".mesh", if that is the case then it creates an entity and uses that mesh. A name is automatically generated based of the entity's name.

- You can create your own "Body type" class based of Actor and NxOgre will use it.