Skip to content

Correct raycast closest hit calculation by subtracting ray origin #108341

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dillona
Copy link

@dillona dillona commented Jul 6, 2025

This PR corrects the calculation of the closest hit point in the 2D raycast implementation of Godot Physics. Previously, the distance was computed using the dot product of the normal and the transformed shape point, which did not account for the ray's origin. This could result in incorrect hit distances, especially when the ray did not start at the origin.

@dillona dillona requested a review from a team as a code owner July 6, 2025 14:16
@AThousandShips AThousandShips added this to the 4.5 milestone Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants