cast_ray already has a sister function called cast_ray_predicate that returns the first hit that satisfies a predicate. The other casts do not.
Solution
Implement them. Note that I set the internal implementations of the non-predicate versions to use the predicate to reduce code duplication. The predicate does not introduce an extra branch since we already have an if for the filter in place, so this should be equivalent in performance.
Changelog
This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section.
Added
cast_ray already has a sister function called cast_ray_predicate that returns the first hit that satisfies a predicate. Now, the other cast function have a similar analogue:
Objective
cast_ray
already has a sister function calledcast_ray_predicate
that returns the first hit that satisfies a predicate. The other casts do not.Solution
if
for the filter in place, so this should be equivalent in performance.Changelog
cast_ray
already has a sister function calledcast_ray_predicate
that returns the first hit that satisfies a predicate. Now, the other cast function have a similar analogue:cast_shape_predicate
forcast_shape
project_point_predicate
forproject_point