changing group/mask of rigidbody

v01d
Posts: 5
Joined: Mon Oct 01, 2012 2:14 am

changing group/mask of rigidbody

Post by v01d »

Hi,
I know it is possible to set the group/mask bits when adding a body to the world, but is it possible to set it afterwards?
I ask because I'm using btBulletWorldImporter and the bodies are added without these values. I would like to set them after deserializing.

Thanks
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: changing group/mask of rigidbody

Post by xexuxjy »

You should be able to. You'll actually be updating the values on the BroadphaseHandle, so it will depend on the underlying implementation , but I think the standard Broadphases allow you to change it.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: changing group/mask of rigidbody

Post by Erwin Coumans »

You can modify the world importer to set the flags, it is all open source and you can derive methods.

If you want to change the flags/mask or other properties of a rigid body, it is best to remove it from the world, make the change, and re-insert it.
v01d
Posts: 5
Joined: Mon Oct 01, 2012 2:14 am

Re: changing group/mask of rigidbody

Post by v01d »

Hi,
thanks for responding. I know it is open source, but I prefer to reuse than reimplement whole methods just to change some parameters. Actually, I use my own importer, but I reuse the "convert*" methods that read the data struct and add the object to the world.

So, there actually is a way to change these values. But, is it really necessary to re-add the body for updates?

Thanks