Hi,
I'm trying to hide and stop simulating a RigidBody at a certain point. I tried doing:
body->setFlags(btRigidBody::CF_STATIC_OBJECT|btRigidBody::CF_DISABLE_VISUALIZE_OBJECT);
but I can still see the body.
Is there any way to do this without deleting or removing the object?
Thanks!!
Hide body
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: Hide body
Code: Select all
enum btCollisionObject::CollisionFlags //object->getCollisionFlags()
{
CF_STATIC_OBJECT= 1,
CF_KINEMATIC_OBJECT= 2,
CF_NO_CONTACT_RESPONSE = 4, //object->hasContactResponse()
CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
CF_CHARACTER_OBJECT = 16,
CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing
};
// So:
myCollisionObject->setCollisionFlags(myCollisionObject->getCollisionFlags()|CF_DISABLE_VISUALIZE_OBJECT);
// Just disables debug drawing for this object
To disable an object from being simulated inside Bullet without taking it off from the world, you must use:
Code: Select all
myCollisionObject->forceActivationState(DISABLE_SIMULATION);
-
- Posts: 39
- Joined: Thu Mar 24, 2011 3:50 pm
Re: Hide body
Thank you very much for your answer!! I'll try it out.