The problem of the rotation,scale,roll,etc

Immoho

24-12-2007 13:26:29

Hi
First of all,I create a body just like this

body = mScene->createBody("monster.mesh",new NxOgre::CubeShape(1.0f),Vector3(500,40,800),"mass:10");
pRobotNode = body->getNode();
body->simulate(0.01);

After that,could I do the opertaions such as rotaion,movement,scale like this?

pRobotNode->yaw(mRotX);


Generally speaking,how u guys create a appliaiton first?
Using the actor,or the body or the character?
After that,do u create a node and attach the actor or body character and using that node to do the scale,rotation,movement?

betajaen

24-12-2007 13:29:58

First of all. You never do this:

body->simulate(0.01);

Ever.

Second, this will never work.

pRobotNode->yaw(mRotX);

Because the next time the PhysX simulation is done, that yaw is nullified. If you want to rotate/move a body, you have to do it through the proper body functions; addTorque, addForce, etc.


Also: http://www.nxogre.org/shortguide/

Immoho

24-12-2007 13:50:25

First of all. You never do this:

body->simulate(0.01);

Ever.

Second, this will never work.

pRobotNode->yaw(mRotX);

Because the next time the PhysX simulation is done, that yaw is nullified. If you want to rotate/move a body, you have to do it through the proper body functions; addTorque, addForce, etc.
Also: http://www.nxogre.org/shortguide/


Is it same to the actor and character?Everything in NxOgre's world,they should be affectted by the forces or the torque?
When I want to move my charcater,should I translate the inputs into the forces or torque?
simulate() is only used in the collision detection,right?The first shape with another shape.

betajaen

24-12-2007 13:58:08

In NxOgre; Actor and Character are not the same. Can you explain what the "Character" is to you?

And you should never touch simulate/render it's not meant to be used that way.

Immoho

24-12-2007 14:12:35

When I want to move my character,should I translate the inputs into the forces or torque?
This character means the one that I controlled,not the NxOgre::Character.

betajaen

24-12-2007 14:51:55

Forces/Torque then.

But you should use the Character for Human players/NPC anything else is sub-par and full of cans of worms.

Immoho

24-12-2007 15:00:22

Forces/Torque then.

But you should use the Character for Human players/NPC anything else is sub-par and full of cans of worms.

How stupid am I.I decided to read the PhysX sdk's Docs instead of bothering u here.All I need is that.
Thank u very much ,betajaen.