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
path: root/source
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-08-22 01:04:42 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-08-22 01:04:42 +0400
commit3d3527eb6dc44a386ed5ac486af3e087af3c7be0 (patch)
tree5b02f8efda9bedf65a63661092f2bce905fa4dee /source
parent8551ac5e089ff224e49398ef15bf189c521d0dbb (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp5
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp4
2 files changed, 6 insertions, 3 deletions
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)
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 312e3258f61..d6a32dfd9c0 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -48,6 +48,10 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
// copy pointers locally to allow smart release
m_MotionState = ci.m_MotionState;
m_collisionShape = ci.m_collisionShape;
+ // apply scaling before creating rigid body
+ m_collisionShape->setLocalScaling(m_cci.m_scaling);
+ if (m_cci.m_mass)
+ m_collisionShape->calculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor);
// shape info is shared, increment ref count
m_shapeInfo = ci.m_shapeInfo;
if (m_shapeInfo)