Simple question on using NxOgre

kirwyd

12-08-2008 11:22:48

I just intergrated NxOgre into my 3d Ogre application by adding these lines:

NxOgre::World* mWorld = new NxOgre::World("time-controller: ogre");
NxOgre::Scene* mScene = mWorld->createScene("Space", "gravity: no, floor: no, renderer: ogre");
NxOgre::Actor* mActor = mScene->createActor("Atlas", new NxOgre::Sphere(0.5), Ogre::Vector3(3, 10, -2), "mass: 10");
mWorld->createDebugRenderer(sceneMgr);


When I start I see the cube moving away. Setting mass to zero fixes this.

I am using no gravity and no floor to simulate outer space. If there is a better way to do this let me know.

I am using NxOgre for collisions between the player and other objects. If I have to use mass: 0 on all my actors how will my actors act when colliding with others?

betajaen

12-08-2008 12:45:33

If there is no need for gravity or a floor as in a space simulation; there is no need to tell NxOgre you don't want it - as it assumes a space simulation anyway.

NxOgre::Scene* mScene = mWorld->createScene("Space", "renderer: ogre");

I believe there is a bug in the ActorParams (which is now fixed) which parses floor:no as floor:yes, just leaving it out should stop the sphere flying away.

As for collisions; there are many ways to detect collisions. Triggers, Intersections, ContactFlags, and so on. The PhysX SDK documentation describes them in full and NxOgre has most of those classes wrapped anyway (they carry the same name as PhysX but without the Nx prefix).

kirwyd

13-08-2008 08:31:38

Thanks for the reply. Leaving it out fixed it.

One question about the network model.

I searched the forums and came up with some threads

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7158&highlight=network

In a client/server model I should not have NxOgre on the client but move the nodes of other players based on physics from the server?

Should I use NxOgre or PhysX on the server? If I use NxOgre I will need Ogre. Can I run Ogre and NxOgre without a render window on the server? Is this the correct way?

I am confused. Currently my server only has networking code. Client authoritive movement server checks against max movement and last position to catch cheaters.