Page 1 of 1

force activation state problem

Posted: Tue May 26, 2015 7:13 pm
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!

Re: force activation state problem

Posted: Wed May 27, 2015 4:23 am
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).

Re: force activation state problem

Posted: Wed May 27, 2015 4:35 pm
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 ).

Re: force activation state problem

Posted: Thu May 28, 2015 2:14 pm
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.