Draft
Conversation
In preparation for sphere sweeps
I only fixed the old tests. No tests for raycasting with radius > 0.
Missed a parameter in HeightFieldShape
Author
|
Also, we should probably write some tests for this and add a sweep radius parameter to the raycast case in the testbed. |
Permissive compliance for latest msvc.
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
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.
It is now possible to specify a radius in the Ray struct. This allows the user to perform sweeps against the world. By default, radius is zero and the raycast functionality works as per usual.
Sweeps have been implemented for the following shapes:
The remaining shapes are:
I could implement it for those shapes as well if you think it would be useful.
One thing that needs to be discussed is which raycast-position and normal should be returned:
For the position you can either return the hit-position where the ray and shape intersect, or the position along the ray where the intersection happened. I'm currently returning the first of these.
For the normal you can either return the surface-normal of the shape that was intersected, or the direction from the hit-position to the position along the ray. I'm currently returning the second of these.
In both case, both of the values are interesting, depending on the situation. Do you think we should extend RaycastInfo with these variables?
This was requested in #243 and #433.