Some noob questions...

zmee

16-04-2009 20:28:50

Hi all,

I started using Ogre3D a couple weeks ago and now I need to use a physics engine, so, first, I picked PhysX, and then knew about NxOgre.

I came across some quetions in the process and would appreciate some help/guidance, so please, bear with me... :oops:

# 1:
I had some problems compiling NxOgre and I actually downloaded 2 diferent sources. The "problem" is, I don't know which NxOgre version I'm using right now, is there a way to know?

# 2:
I think I understand the diference between an Actor and a Body. The Actor is the "actual thing" in the scene, and the body is its representation. In the forum, I found two ways of creating an actor:

_scene->createActor("Actor",new NxOgre::Cube(1.0),node->getPosition(),actorparams);

or

//actually, I couldn't compile the code with this one (yet :D)
_scene->createBody(nrp.mIdentifier,new NxOgre::Cube(1.0),node->getPosition(),nrp,NxOgre::ActorParams("mass: 10"));


In the second one, we still specify the Cube shape... My question is, why do we still need to specify the Cube shape and wich one is used in collision detection (the cube shape, or the body actual body created with the specified nrp.mGraphicsModel)?


Thanks in advance :wink:

betajaen

16-04-2009 21:07:53

You can find out the version of NxOgre by searching for or using Intellisense to find NXOGRE_VERSION (or variation upon that). Generally if you see "Bleeding" anywhere it's 1.0.22Tx, BloodyMess 1.5 and anything else is likely to be 0.9. From the source you've provided it looks like Bleeding.

You give a cube shape (or any other shape) because the real model that you see on the screen is to inefficient or not in the correct format to work with PhysX. Generally when it comes to collision detection; the simpler the better.

For example a computer keyboard; Your Ogre model may have a very well done any hi-res model where each key is made out of many polygons. For PhysX and any physics library this is very difficult to work from, a far easier solution is just to provide a cuboid shape which gives enough accuracy to make it believable.

Fred

23-04-2009 22:13:12


//actually, I couldn't compile the code with this one (yet :D)
_scene->createBody(nrp.mIdentifier,new NxOgre::Cube(1.0),node->getPosition(),nrp,NxOgre::ActorParams("mass: 10"));


Maybe you should try to use: _scene->createBody<NxOgre::Body>(nrp.mIdentifier,new NxOgre::Cube(1.0),node->getPosition(),nrp,NxOgre::ActorParams("mass: 10"));
In my own codes I also use a static_cast: static_cast<NxOgre::Body*>(level_.get_scene()->createBody<NxOgre::Body>(vis_id, shape, NxOgre::Pose(position_), params));
I don't know, why I do so, but perhaps it doesn't work otherwise ;)

betajaen

23-04-2009 23:31:16

Hey Fred! You've gone missing for a while now, where have you been?

Fred

24-04-2009 09:53:52

Oh I didn't expected, that anyone would realize that I was away for a while. ;)
In the last weeks and months I have been programming on my own project. And on the one hand, I did not have any problems with NxOgre, so I could not ask some questions. On the other hand I don't use fluids, cars, humans or bloody mess, so I could not really answer some questions ;)

zmee

03-05-2009 23:31:16

Hey,

I had to "halt" my project for a while, so I didn't check the topic as soon as I should.

So, thanks betajaen and Fred for your replies.