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
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp')
-rw-r--r--extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp
index 5ddacd05d05..919d1f9e58c 100644
--- a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp
+++ b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp
@@ -39,10 +39,12 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
MassProps mp(ci.m_mass, ci.m_localInertiaTensor);
m_body = new RigidBody(mp,0,0,ci.m_friction,ci.m_restitution);
+
+ m_body->SetCollisionShape( ci.m_collisionShape);
+
m_broadphaseHandle = ci.m_broadphaseHandle;
- m_collisionShape = ci.m_collisionShape;
//
// init the rigidbody properly
@@ -67,7 +69,6 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
CcdPhysicsController::~CcdPhysicsController()
{
//will be reference counted, due to sharing
- //delete m_collisionShape;
delete m_MotionState;
delete m_body;
}
@@ -89,12 +90,18 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time)
m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]);
SimdVector3 scaling(scale[0],scale[1],scale[2]);
- m_collisionShape->setLocalScaling(scaling);
-
+ m_body->GetCollisionShape()->setLocalScaling(scaling);
return true;
}
+CollisionShape* CcdPhysicsController::GetCollisionShape()
+{
+ return m_body->GetCollisionShape();
+}
+
+
+
/**
WriteMotionStateToDynamics synchronizes dynas, kinematic and deformable entities (and do 'late binding')
*/