diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2009-04-29 03:26:35 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2009-04-29 03:26:35 +0400 |
commit | 2d78dcfb610381a5056eed5f59dd57aa50e444c3 (patch) | |
tree | 0d904d31a8ec69b554f4fdacbbb0e57aafa6ce92 /source/gameengine/Physics | |
parent | e4abebfa9153a0aae6eab438b89020c1f5af42ee (diff) |
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?
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index b171fbb3c34..961e9096442 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -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); + } } } |