mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 13:20:07 +00:00
Merge pull request #3361 from erwincoumans/master
@erwincoumans PyBullet: try to address activation/deactivation issue with fixed base multibody
This commit is contained in:
commit
7f7238f630
@ -24,6 +24,7 @@ subject to the following restrictions:
|
|||||||
#define WANTS_DEACTIVATION 3
|
#define WANTS_DEACTIVATION 3
|
||||||
#define DISABLE_DEACTIVATION 4
|
#define DISABLE_DEACTIVATION 4
|
||||||
#define DISABLE_SIMULATION 5
|
#define DISABLE_SIMULATION 5
|
||||||
|
#define FIXED_BASE_MULTI_BODY 6
|
||||||
|
|
||||||
struct btBroadphaseProxy;
|
struct btBroadphaseProxy;
|
||||||
class btCollisionShape;
|
class btCollisionShape;
|
||||||
@ -304,7 +305,7 @@ public:
|
|||||||
|
|
||||||
SIMD_FORCE_INLINE bool isActive() const
|
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)
|
void setRestitution(btScalar rest)
|
||||||
|
@ -545,7 +545,10 @@ public:
|
|||||||
{
|
{
|
||||||
m_canWakeup = canWakeup;
|
m_canWakeup = canWakeup;
|
||||||
}
|
}
|
||||||
bool isAwake() const { return m_awake; }
|
bool isAwake() const
|
||||||
|
{
|
||||||
|
return m_awake;
|
||||||
|
}
|
||||||
void wakeUp();
|
void wakeUp();
|
||||||
void goToSleep();
|
void goToSleep();
|
||||||
void checkMotionAndSleepIfRequired(btScalar timestep);
|
void checkMotionAndSleepIfRequired(btScalar timestep);
|
||||||
|
@ -139,7 +139,7 @@ void btMultiBodyDynamicsWorld::updateActivationState(btScalar timeStep)
|
|||||||
{
|
{
|
||||||
if (body->hasFixedBase())
|
if (body->hasFixedBase())
|
||||||
{
|
{
|
||||||
col->setActivationState(ISLAND_SLEEPING);
|
col->setActivationState(FIXED_BASE_MULTI_BODY);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
col->setActivationState(WANTS_DEACTIVATION);
|
col->setActivationState(WANTS_DEACTIVATION);
|
||||||
|
Loading…
Reference in New Issue
Block a user