fix so that torque can be applied to DYNAMIC game objects, this fixes the skategirl.

Note that skategirl needs a bit higher angular damping, perhaps the conversion formula needs to be tweaked better?
This commit is contained in:
Erwin Coumans 2009-04-28 23:26:35 +00:00
parent e4abebfa91
commit 2d78dcfb61

@ -964,7 +964,14 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque
torque = xform.getBasis()*torque;
}
if (body)
{
//workaround for incompatibility between 'DYNAMIC' game object, and angular factor
//a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque
const btVector3& angFac = body->getAngularFactor();
body->setAngularFactor(1.f);
body->applyTorque(torque);
body->setAngularFactor(angFac);
}
}
}