Hey everyone, a quick idea for an enhancement proposal here;
Enable Bullet to use the collision callback in the RayCast and MouseOver algorithm so that we can choose to raycast through certain objects.
I’m sure that this would be useful, and if not immediately possible due to the nature of Bullet, would offer some incentive to add additional narrowphase callback support for collision masks & groups.
You mean to ignore certain objects (in opposite to x-ray which detects specific objects only?)
How you would setup such things in the GUI?
I haven’t looked at this callbacks. Is there a doc with it?
We already filter collisions based upon the group and mask of colliding objects. It would be sensible to extend this to the ray sensor (for example). You may select the collision “group” that the ray can collide with. In my opinion you needn’t specify a mask because ray’s are technically non-physical (they wouldn’t cause a noticeable reaction when colliding with a Physics body) so the collision only has to be one way.
Callbacks are a part of Bullet’s internal design. They’re used to allow custom collision behaviour. Currently we use a function on the GameObject to check if objects may collide before they’re included in the broadphase (http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Broadphase) This doesn’t however prevent/cause collisions if the objects are already in the broadphase cache.