-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add predicate variants to all casts (#493)
# Objective - `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: - Added `cast_shape_predicate` for `cast_shape` - Added `project_point_predicate` for `project_point`
- Loading branch information
1 parent
f2dec36
commit 950fd61
Showing
1 changed file
with
75 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters