-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use Direction3d for gizmos.circle normal #11422
Conversation
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.
Could you use a Direction3d
instead of a Vec3
so that it doesn't't have to be normalised? http://dev-docs.bevyengine.org/bevy/prelude/primitives/struct.Direction3d.html
Sure! Gave that a go. This does slightly conflict with @alice-i-cecile comment in #11401 though. Maybe callees using Direction3d::new(vec).unwrap_or(Direction3d::Y) isn't too bad. Maybe could be worth having a Direction3d::new_or(vec, Direction3d::Y) ? Not sure. |
I prefer the type-safe validation to my suggestion linked :) |
@rodolphito review? |
Objective
Fix weird visuals when drawing a gizmo with a non-normed normal.
Fixes #11401
Solution
Just normalize right before we draw. Could do it when constructing the builder but that seems less consistent.
Changelog
Migration Guide
Direction3d::new(vec).unwrap_or(default)
or potentiallyDirection3d::new_unchecked(vec)
if you know your vec is definitely normalized.