diff options
author | erwin coumans <erwin.coumans@gmail.com> | 2021-04-24 23:52:53 -0700 |
---|---|---|
committer | erwin coumans <erwin.coumans@gmail.com> | 2021-04-24 23:52:53 -0700 |
commit | 3b2e46e7dd5693dc3389fa00626c888fc3c1128a (patch) | |
tree | 879d21e80428df0feb79fa0ad7ad15a56b747d7b | |
parent | 6cb72b5128715d080ef14adfab3b3419546111a5 (diff) | |
download | bullet3-3b2e46e7dd5693dc3389fa00626c888fc3c1128a.tar.gz |
PyBullet: try to address activation/deactivation issue with fixed base multibody with links.
-rw-r--r-- | src/BulletCollision/CollisionDispatch/btCollisionObject.h | 3 | ||||
-rw-r--r-- | src/BulletDynamics/Featherstone/btMultiBody.h | 5 | ||||
-rw-r--r-- | src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/BulletCollision/CollisionDispatch/btCollisionObject.h index e085c4089..dbe82fd61 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -24,6 +24,7 @@ subject to the following restrictions: #define WANTS_DEACTIVATION 3 #define DISABLE_DEACTIVATION 4 #define DISABLE_SIMULATION 5 +#define FIXED_BASE_MULTI_BODY 6 struct btBroadphaseProxy; class btCollisionShape; @@ -304,7 +305,7 @@ public: SIMD_FORCE_INLINE bool isActive() const { - return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION)); + return ((getActivationState() != FIXED_BASE_MULTI_BODY) && (getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION)); } void setRestitution(btScalar rest) diff --git a/src/BulletDynamics/Featherstone/btMultiBody.h b/src/BulletDynamics/Featherstone/btMultiBody.h index b48b3d1a0..345970d26 100644 --- a/src/BulletDynamics/Featherstone/btMultiBody.h +++ b/src/BulletDynamics/Featherstone/btMultiBody.h @@ -545,7 +545,10 @@ public: { m_canWakeup = canWakeup; } - bool isAwake() const { return m_awake; } + bool isAwake() const + { + return m_awake; + } void wakeUp(); void goToSleep(); void checkMotionAndSleepIfRequired(btScalar timestep); diff --git a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp index 9f304929c..e7af332eb 100644 --- a/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp +++ b/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp @@ -139,7 +139,7 @@ void btMultiBodyDynamicsWorld::updateActivationState(btScalar timeStep) { if (body->hasFixedBase()) { - col->setActivationState(ISLAND_SLEEPING); + col->setActivationState(FIXED_BASE_MULTI_BODY); } else { col->setActivationState(WANTS_DEACTIVATION); |