From 3d3527eb6dc44a386ed5ac486af3e087af3c7be0 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 Aug 2008 21:04:42 +0000 Subject: BGE bug #17411 fixed: the always sensor is called before the the scale of the object is applied. The scale is now applied to the shape before the creation of the rigid body. --- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp') diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index c95ab954022..d6997ee29a8 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -801,9 +801,6 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, } bm->setMargin(0.06); - if (objprop->m_dyna) - bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); - if (objprop->m_isCompoundChild) @@ -905,6 +902,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_collisionFilterGroup = (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : short(CcdConstructionInfo::StaticFilter); ci.m_collisionFilterMask = (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody; + MT_Vector3 scaling = gameobj->NodeGetWorldScaling(); + ci.m_scaling.setValue(scaling[0], scaling[1], scaling[2]); KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna); // shapeInfo is reference counted, decrement now as we don't use it anymore if (shapeInfo) -- cgit v1.2.3