diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-06-19 02:10:00 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-06-19 02:10:00 +0400 |
commit | ec8448b88d9285624d61ce9196c7ad3643dc921e (patch) | |
tree | a8b88feac6e25d1c8aa0e45fb1a018e3b2b30e6c /source/gameengine/Physics | |
parent | dcbcc125824c6debc082b7ba36082602bc63f9d3 (diff) |
bugfix/workaround for problem with hard-coded collision margins being too large.
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 22 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.h | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index cddc780aff4..60b8dbbf862 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -210,6 +210,28 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta } +void CcdPhysicsController::SetMargin(float margin) +{ + if (m_body && m_body->GetCollisionShape()) + { + m_body->GetCollisionShape()->SetMargin(margin); + } + + +} + +float CcdPhysicsController::GetMargin() const +{ + if (m_body && m_body->GetCollisionShape()) + { + return m_body->GetCollisionShape()->GetMargin(); + } + + return 0.f; + +} + + // kinematic methods void CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 056feba652c..7488e74db01 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -160,8 +160,8 @@ class CcdPhysicsController : public PHY_IPhysicsController virtual void calcXform() {} ; - virtual void SetMargin(float margin) {}; - virtual float GetMargin() const {return 0.f;}; + virtual void SetMargin(float margin); + virtual float GetMargin() const; bool wantsSleeping(); |