-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
fix: Ray should not be able to escape CircleHitbox
#3341
Conversation
// of the circle and then directly intersecting and causing the reflecting | ||
// ray to go in the wrong direction. | ||
_temporaryOrigin.setValues( | ||
ray.origin.x + ray.direction.x * 0.00001, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we put that into an epsilon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious though what changed that caused this to break? And couldn't it be that the point started in a "good" place but when you add the small epsilon it ends in a "bad" place?
It can happen, but it's very unlikely since the epsilon is so small. So the problem was that it properly calculates the first ray, but then it's calculating what the reflection ray will intersect and since its origin is straight on the edge of the circle sometimes the origin point was counted as the intersection, so we add a small vector to origin with the same direction as the ray to "get out" of the origin. |
A raycasted ray should not be able to escape a `CircleHitbox` if it originates from inside of it (or on the edge and has a direction inwards). Fixes: #3333
Description
A raycasted ray should not be able to escape a
CircleHitbox
if it originates from inside of it (or on the edge and has a direction inwards).Fixes: #3333
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Related Issues