Filter group #176
-
How to create a filter that is used to selectively ignore objects when casting a ray. I want to split the objects in the simulation into two groups, and selectively ignore one of the groups when casting a ray. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Exactly how the filtering data is stored or computed is up to you. It can be helpful to have a mapping from collidable reference to other data- bepuphysics2/Demos/Demos/RagdollDemo.cs Line 97 in 11f7e09 |
Beta Was this translation helpful? Give feedback.
IRayHitHandler
has anAllowTest
callback that is called before doing any testing. It passes in a collidable reference you can use to look up filter data.Exactly how the filtering data is stored or computed is up to you. It can be helpful to have a mapping from collidable reference to other data-
CollidableProperty<T>
is a helper class that exists for that purpose. For example, to implement narrow phase pair filtering, the ragdoll demo uses it:bepuphysics2/Demos/Demos/RagdollDemo.cs
Line 97 in 11f7e09