physics questions

mamairaja

27-10-2009 17:32:15

Hi
I have 2 questions regard to physics
1. I have created a body with following RigidBodyDescription
NxOgre::RigidBodyDescription enemyPhysicsDescription;
enemyPhysicsDescription.mMass = 70.0f;
enemyPhysicsDescription.mBodyFlags |= NxOgre::Enums::BodyFlags::BodyFlags_FreezeRotationZ;
enemyPhysicsDescription.mBodyFlags |= NxOgre::Enums::BodyFlags::BodyFlags_FreezeRotationX;

I have tried to jump the character using addForce method. The problem is I had to apply a huge force to make the body jump a little y directional distance.
enemyBody->addForce(NxOgre::Vec3(0,30000,0));
Why it requires that much amount of force Newton 30000 for 70 kg mass?

2. The second one is related to nxogre.
If I need to rotate the body for a particular distance what is the method I have to use. I have not managed to find a way to use Quaternion with a OGRE3DBody. Even if i can use setAngularVelocity how to stop the body when it reached that particular direction?

Thank you in advance

LucaMoller

28-11-2009 03:50:20

For how much time did you add this force to the body? ( A force generate aceleration, not speed... Even if you have giant mega force and apply it only for 0.001 seconds the final speed may change just a bit).
You can try to setSpeed() or setLineatMomentum() to put the body instantly on the desired speed to start the jump (its a good solution if you dont care too much about the aceleration time).

Isn't there a setGlobalOrientation() method or something similar so you can set the body orientation with a quaternion?