Only apply advanced setting of angular/linear factor to rigid bodies (with angular...
authorErwin Coumans <blender@erwincoumans.com>
Sun, 29 Mar 2009 18:34:35 +0000 (18:34 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Sun, 29 Mar 2009 18:34:35 +0000 (18:34 +0000)
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp

index 9b2d740397434a0d157db8862e2d4947f359683b..8002da6b8d4e942fcf534a5ce069ca5a6e373740 100644 (file)
@@ -1106,16 +1106,19 @@ void    KX_ConvertBulletObject( class   KX_GameObject* gameobj,
 
                if (rbody)
                {
-                       btVector3 linearFactor(
-                               objprop->m_lockXaxis? 0 : 1,
-                               objprop->m_lockYaxis? 0 : 1,
-                               objprop->m_lockZaxis? 0 : 1);
-                       btVector3 angularFactor(
-                               objprop->m_lockXRotaxis? 0 : 1,
-                               objprop->m_lockYRotaxis? 0 : 1,
-                               objprop->m_lockZRotaxis? 0 : 1);
-                       rbody->setLinearFactor(linearFactor);
-                       rbody->setAngularFactor(angularFactor);
+                       if (objprop->m_angular_rigidbody)
+                       {
+                               btVector3 linearFactor(
+                                       objprop->m_lockXaxis? 0 : 1,
+                                       objprop->m_lockYaxis? 0 : 1,
+                                       objprop->m_lockZaxis? 0 : 1);
+                               btVector3 angularFactor(
+                                       objprop->m_lockXRotaxis? 0 : 1,
+                                       objprop->m_lockYRotaxis? 0 : 1,
+                                       objprop->m_lockZRotaxis? 0 : 1);
+                               rbody->setLinearFactor(linearFactor);
+                               rbody->setAngularFactor(angularFactor);
+                       }
 
                        if (rbody && objprop->m_disableSleeping)
                        {