Why Actor is not Moving with SceneNode

Dmitriy

08-05-2012 11:48:04

I enabled visualDebugger to see Physics Actor which describes rigidBody. In my case it is Box which I created that way:


[b]NxOgre::BoxDescription box;
box.mSize(60,100,60);[/b]
mBody = mRenderSystem->createBody(box_desc,NxOgre::Vec3(0.0f,1000.0f,0.0f),"boat.mesh",bodyDesc);
this->_hydroNode = mBody->getNode()->getSceneNode();


Now I can see bounding box around my model, but when I Moving SceneNode in frameStarted method that way:

this->_hydroNode->translate(move * evt.timeSinceLastFrame,Ogre::Node::TS_LOCAL);


my mesh is moving normally, but Actor(bounding box), is stand still. I thought that Actor and RigidBody connects to the same Node. What am I doing wrong???

betajaen

08-05-2012 15:07:58

Because Ogre does not know about PhysX or NxOgre, and therefore doesn't tell it that Actor has moved.

Translate your Actor, through the Body.

Dmitriy

09-05-2012 02:37:46

Ok thanx, but there is no such method in the Body class? How should I translate?

betajaen

09-05-2012 08:42:47

Adding a Force?

Dmitriy

11-05-2012 14:13:16

mmm, thanx, but is there any way to move the body without adding forces? For example: I pick up my object by mouse and drag it to another position without simulating physics, just change position.

betajaen

11-05-2012 21:11:18

There is no way to translate an Actor like you do in Ogre, other essentially your teleporting the Actor in small steps - this upsets the simulation, as it can't predict where the Actor will be.

There are two ways to do this;

- Forces
- Changing Linear Velocity.

You can also use a KinematicActor, which does support translation - but doesn't do forces, or responds to collisions, or gravity.