Skip to content

Conversation

@haraldwer
Copy link

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:

  • AABB
  • Box
  • Capsule
  • Sphere
  • Triangle

The remaining shapes are:

  • ConcaveMesh
  • ConvexMesh
  • HeightField

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.

@haraldwer
Copy link
Author

Also, we should probably write some tests for this and add a sweep radius parameter to the raycast case in the testbed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant