force activation state problem

Post Reply
gdlk
Posts: 62
Joined: Fri Oct 24, 2014 7:01 pm

force activation state problem

Post by gdlk »

Hi!

I have an issue with the force activation state. I am trying to disable some bodies from simulation (I have too much object to dynamic remove/readd to the world (too slow =( )), so I am using forceActivationState method with DISABLE_SIMULATION. However, if some object collision with the object with DISABLE_SIMULATION state, the object still react to the collision. What step I am missing? D=

The world is a btDiscreteDynamicsWorld and bullet is version 2.83. To test the issue, I add a rigid body on the basic example and force the state after creation.

Regards!
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: force activation state problem

Post by drleviathan »

I looked at the Bullet-2.8.2 code for btDiscreteDynamicsWorld and found that, while processing m_nonStaticRigidBodies, it often pivots its logic on the return value of btCollisionObject::isKinematicOrStaticObject(). So, if you're using Bullet-2.8.x then you should try setting the object static using btCollisionObject::setCollisionFlags(btCollisionObject::CF_STATIC_OBJECT).
gdlk
Posts: 62
Joined: Fri Oct 24, 2014 7:01 pm

Re: force activation state problem

Post by gdlk »

drleviathan wrote:I looked at the Bullet-2.8.2 code for btDiscreteDynamicsWorld and found that, while processing m_nonStaticRigidBodies, it often pivots its logic on the return value of btCollisionObject::isKinematicOrStaticObject(). So, if you're using Bullet-2.8.x then you should try setting the object static using btCollisionObject::setCollisionFlags(btCollisionObject::CF_STATIC_OBJECT).
Thanks! but the trick don't work =( , the object still is simulated ( still detect/react to collision ).
dern23
Posts: 26
Joined: Thu Oct 04, 2012 1:58 pm

Re: force activation state problem

Post by dern23 »

If you don't want any action at all, you'll need to remove the rigid body from the world, and add it back in again when simulation is required. Position and velocity is stored in the body so it should be pretty seamless.
Post Reply