Currently I'm using a custom ray callback "with exclusion" to exclude a particular object (in my case a frustum ghost object) from ray tests.
Anyway I'm wondering if by default ray tests should exclude objects with NO_CONTACT_RESPONSE: I'm thinking of ray tests used for picking, raycast vehicles, and so on that shouldn't return invisible and inert objects used like sensors.
Maybe the current two (ray and convex) tests in btCollisionWorld should exclude these objects by default and two more (ray and convex) tests can be added as "Universal" tests (that can be used for benchmarking in the Bullet Demos about ray testing).
What do you think about it?
P.S. I don't think it's possible to simply add a filter to the ray test, because the NO_CONTACT_RESPONSE is part of another set of flags (but I can be wrong).
Should ray tests detect objects without contact response?
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Should ray tests detect objects without contact response?
It should be possible to exclude sensors and other objects using collision filter flags. You could assign the CollisionFilterGroups::SensorTrigger to sensors.
Alternatively, you can always derive a class from RayResultCallback and override 'needsCollision' for custom custom filtering for the ray test.
Hope this helps,
Erwin
Alternatively, you can always derive a class from RayResultCallback and override 'needsCollision' for custom custom filtering for the ray test.
Hope this helps,
Erwin
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: Should ray tests detect objects without contact response?
This was exactly what I was looking for! Thank you.It should be possible to exclude sensors and other objects using collision filter flags. You could assign the CollisionFilterGroups::SensorTrigger to sensors.