diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-12-01 04:04:27 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-12-01 04:04:27 +0300 |
commit | 4941107f927c3717a113b82463193caae0022d8c (patch) | |
tree | 2f4de94b1bb53233e54f49a732a0f4d90df14bf8 /source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | |
parent | 51ce503cb24de6fa928555359acce77beed8995e (diff) |
- enabled compound collision objects, requires 'clear parent inverse'
- fixed some issues with kinematic objects, introduced during Bullet 2.x upgrade
Diffstat (limited to 'source/gameengine/Ketsji/KX_BulletPhysicsController.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index d28a8f40d6f..6785cb957bc 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -195,6 +195,34 @@ SG_Controller* KX_BulletPhysicsController::GetReplica(class SG_Node* destnode) void KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly) { + GetRigidBody()->activate(true); + + if (!m_bDyna) + { + GetRigidBody()->setCollisionFlags(GetRigidBody()->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + } else + { + if (!nondynaonly) + { + btTransform worldTrans; + GetRigidBody()->getMotionState()->getWorldTransform(worldTrans); + GetRigidBody()->setCenterOfMassTransform(worldTrans); + + /* + scaling? + if (m_bDyna) + { + m_sumoObj->setScaling(MT_Vector3(1,1,1)); + } else + { + MT_Vector3 scale; + GetWorldScaling(scale); + m_sumoObj->setScaling(scale); + } + */ + + } + } } // todo: remove next line ! |