[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20809] trunk/blender/source/gameengine/ Physics/Bullet/CcdPhysicsController.cpp: Bugfix for [#18911] Applied torque breaks rigid bodies in game engine

Erwin Coumans blender at erwincoumans.com
Thu Jun 11 15:42:41 CEST 2009


Revision: 20809
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20809
Author:   erwin
Date:     2009-06-11 15:42:41 +0200 (Thu, 11 Jun 2009)

Log Message:
-----------
Bugfix for [#18911] Applied torque breaks rigid bodies in game engine

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-06-11 11:54:56 UTC (rev 20808)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp	2009-06-11 13:42:41 UTC (rev 20809)
@@ -1016,14 +1016,21 @@
 		}
 		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);
+			} 
+		} 
 	}
 }
 





More information about the Bf-blender-cvs mailing list