Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2009-06-11 17:42:41 +0400
committerErwin Coumans <blender@erwincoumans.com>2009-06-11 17:42:41 +0400
commitdb8b4cee565676658bf6042a05b763654769f3a2 (patch)
treec7d47baf0b4e428184be6b271580dc5400ea9db4 /source/gameengine
parentbf729ab26879cd290696f5950a09c423bafdebc0 (diff)
Bugfix for [#18911] Applied torque breaks rigid bodies in game engine
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index d22c09b4d3e..3e20203a4cc 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1016,14 +1016,21 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float 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();
- btVector3 tmpFac(0,0,1);
- body->setAngularFactor(tmpFac);
- body->applyTorque(torque);
- body->setAngularFactor(angFac);
- }
+ if (m_cci.m_bRigid)
+ {
+ body->applyTorque(torque);
+ }
+ else
+ {
+ //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();
+ btVector3 tmpFac(0,0,1);
+ body->setAngularFactor(tmpFac);
+ body->applyTorque(torque);
+ body->setAngularFactor(angFac);
+ }
+ }
}
}