-
-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Support multiple intersections for ray casting #108022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tucono
wants to merge
17
commits into
godotengine:master
Choose a base branch
from
tucono:multiple_ray_intersect_jolt_rebase
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support multiple intersections for ray casting #108022
tucono
wants to merge
17
commits into
godotengine:master
from
tucono:multiple_ray_intersect_jolt_rebase
+352
−52
Conversation
This file contains hidden or 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
TODO: Remove this from commit history
… gd physics needs fixing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Largely an update of PR #91303 (handling godotengine/godot-proposals#9059 and godotengine/godot-proposals#2616) to support Jolt Physics - however there are a few key differences.
This PR is to support multiple collisions for raycasts in 2D and 3D space provided by a new
intersect_ray_multiple
function. This function behaves somewhat similarly to theintersect_point
methods which are provided a maximum number of allowable collisions. Once that number has been reached, the function will return (potentially not yielding all collisions along the raycast). However, if the maximum number of collisions provided is1
, then it will behave the same as the currentintersect_ray
method and return only the closest intersection.The return is an unsorted array of dictionaries with the same parameters as the current intersect_ray methods. One curiosity I have seen between Jolt and Godot Physics is that Godot Physics only provides the closest hit on a convex mesh collision shape whereas Jolt provides all collisions where the normal is opposed to the raycast.

I've tried to do a good amount of testing with some simple documentation in the attached pdf. However, I doubt I have tested all possibilities since there are a large number of options for raycasts. I would highly welcome any additional testing.
Validation.pdf