Physics and ColliderDistanceInput with Filter Override

Another request for the dots physics team. Please add an option in the ColliderDistanceInput struct for a filter override of the collider blob being calculated.

Currently, I am cloning the source collider then editing the filter of that collider before using it as the input of the calculate distance method. Then disposing of it once the calculation is complete.

To confirm my understanding, in your case there is a collision filter on the collider you are using in ColliderDistanceInput and you would like it to be ignored in the distance query. Is that correct?

1 Like

Yes and I would like an option to override the filter of the collider being used in the CDI.

One situation I have right now is on a player entity, I need to find all colliders of a specific layer around it in a certain radius. But the collider itself can collide with everything. If I were to use the player's collider as the input as-is, it'll return a lot of junk collider hits that I will then need to filter out in an additional step.

So right now I'm cloning the player collider and setting the filter to the layer I want and using the cloned collier as the input.

I would like an option to skip the cloning and simply override the filter of the original collider for this specific collider distance input query.

1 Like

That makes a lot of sense. I've relayed your feature request internally.

1 Like