prchakal
25-11-2009 11:34:41
Hi,
Im trying to add a force on my player controller callback, but when i add the force, nothing happen with the player, what i can make wrong?
Im trying to add a force on my player controller callback, but when i add the force, nothing happen with the player, what i can make wrong?
void EnginePlayer::forceCallback(OgreNewt::Body *body, float timeStep, int threadIndex) {
//obtém massa e inércia
Ogre::Real mass;
Ogre::Vector3 inertia;
body->getMassMatrix(mass, inertia);
//define variável de controle do pulo
Vector3 jumpVelocity(0, _jumpVelocity, 0);
//define física do pulo
if (_jumping == true) {
body->addForce(jumpVelocity); <- the debugger stop here, and add Vector3(0, -100, 0) but nothing happen
}
//adiciona gravidade
Ogre::Vector3 gravity = EngineGlobalObjects::getInstance().getConfiguration()->getGravity() * mass;
body->addForce(gravity);
}