Revision: 19966
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19966
Author:   erwin
Date:     2009-04-29 01:26:35 +0200 (Wed, 29 Apr 2009)

Log Message:
-----------
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?

Modified Paths:
--------------
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

Modified: 
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp     
2009-04-28 20:19:36 UTC (rev 19965)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp     
2009-04-28 23:26:35 UTC (rev 19966)
@@ -964,7 +964,14 @@
                        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);
+               }
        }
 }
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to