-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 look_to variable naming #8627
Conversation
In rust the minus sign let back = -( direction.try_normalize().unwrap_or(Vec3::Z) ); I still suggest a change though. It's a bit clearer: let back = direction.try_normalize().map_or(-Vec3::Z, |d| -d); The change from |
Why default value should be |
I think it's OK (but not important) to change it to |
Added migration guide! Another question, I think |
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.
Keep it as unwrap_or
if you think it's more readable. I think it's good enough.
I can't comment on it, but at line 354 there is this:
/// * if `up` is zero, `Vec3::Y` is used instead
This needs to be replaced by
/// * if `up` is zero, `Vec3::NEG_Y` is used instead
You mean
? |
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.
Good job! I think this change is positive.
Appears to be no longer breaking :) |
@lewiszlw can you update the PR description to reflect the final state of this PR? |
The default behavior changed when direction can't be normalized. So marked it breaking. @alice-i-cecile |
Objective
direction
, so the negative ofdirection
should be back.Migration Guide
Transform::look_to
method changed default value ofdirection.try_normalize()
fromVec3::Z
toVec3::NEG_Z