|
Hi guys.
I have a performance problem at the moment, due to the fact that all my kinematic objects (about 100) in my scene have the DISABLE_DEACTIVATION activation flag set.
I had a look through the forum, some old messages from Erwan recommend to use this flag for kinematic objects (as long as they are moving), while some newer ones are saying this flag shouldn't use as it's an internal flag.
Now, what's the best strategy to handle kinematic objects, which use motion states ?
- if nothings gets done, the rigid body are deactivated if not moving. When they start moving again, the rigid body transform is not updated anymore. - if using the DISABLE_DEACTIVATION flag, performance drops considerably, as most of the kinematic objects are still, but still perform collision detection with terrain
I came up with the following solution: each frame, detect if the object has moved, in which case, call "m_pRigidBody->setActivationState(ACTIVE_TAG);" to wake it up.
Is there any other better option ? Couldn't Bullet handle this automatically ?
|