diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-02-13 01:56:50 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-02-13 01:56:50 +0300 |
commit | 9e217ccb2e111e051b2835a518fba02ffe97bfe3 (patch) | |
tree | 67215f22cf2237e3a2b52217b561718dd92751e4 | |
parent | eda2d563bc2a1333ba98e26e192167cadcc26026 (diff) |
BGE Fix T39026: No collisions detected with parented rigid body object
Fix for T39026. Preliminary investigation by blenderscripter on D446.
Also it solves bug T41285 (Parenting object leave collission box).
Refactor commit b90de0331df6c92af909b20a3e183596ff3511e4 introduced a
regression bug.
Reviewers: sergof, campbellbarton, moguri
Reviewed By: moguri
Subscribers: blueprintrandom, blenderscripter
Differential Revision: https://developer.blender.org/D1064
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index ff68021f09e..08fcb243445 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -148,6 +148,7 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci) m_savedCollisionFilterGroup = 0; m_savedCollisionFilterMask = 0; m_savedMass = 0.0; + m_savedDyna = false; m_suspended = false; CreateRigidbody(); @@ -1068,6 +1069,7 @@ void CcdPhysicsController::SuspendDynamics(bool ghost) m_savedCollisionFlags = body->getCollisionFlags(); m_savedMass = GetMass(); + m_savedDyna = m_cci.m_bDyna; m_savedCollisionFilterGroup = handle->m_collisionFilterGroup; m_savedCollisionFilterMask = handle->m_collisionFilterMask; m_suspended = true; @@ -1076,6 +1078,7 @@ void CcdPhysicsController::SuspendDynamics(bool ghost) btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)), btBroadphaseProxy::StaticFilter, btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter); + m_cci.m_bDyna = false; } } @@ -1092,6 +1095,7 @@ void CcdPhysicsController::RestoreDynamics() m_savedCollisionFilterGroup, m_savedCollisionFilterMask); body->activate(); + m_cci.m_bDyna = m_savedDyna; m_suspended = false; } } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 557a5fe603a..be393bbfa7f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -480,6 +480,7 @@ protected: short m_savedCollisionFilterGroup; short m_savedCollisionFilterMask; MT_Scalar m_savedMass; + bool m_savedDyna; bool m_suspended; |