-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add Transform::{look_at_rh, look_at_lh} and deprecate look_at (continued) #514
base: master
Are you sure you want to change the base?
Changes from all commits
e337856
a4ea451
09593fb
dc084e1
b9350a3
faa69b6
64e88bd
121c77b
f2284a5
d9d89de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -484,8 +484,8 @@ impl<S: BaseFloat> Rotation for Quaternion<S> { | |
type Space = Point3<S>; | ||
|
||
#[inline] | ||
fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was hoping to consolidate the look functions in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess my thinking is that it needs the handedness for it to be consistent and I don't think the implementations are consistent right now (i.e. they're not all LH or all RH and some of the implementations are on the raw structs instead of the traits). What I think needs to happen is that someone needs to go through the remaining I was also thinking that it doesn't really make sense to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Agreed, so shall we punt that to another PR? |
||
Matrix3::look_at(dir, up).into() | ||
fn look_to(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S> { | ||
Matrix3::look_to_lh(dir, up).into() | ||
} | ||
|
||
#[inline] | ||
|
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.
This should be
look_to_{lh|rh}
. I didn't update these because I didn't know what the current implementation was.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.
Is there a handedness distinction for 2D rotations?
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.
I think that there is because handedness defines the direction of rotation. However, I had the same (unresolved) question which is why I decided not to modify it in the other PR. My reasoning was that it's probably better to leave it alone until I (or someone else) has time to figure out the correct path forward.
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.
I'm confused. I thought handedness determines between coordinate systems. The direction of rotation should be indistinguishable here. I.e. the rotation is the same regardless of which way you turn. For 2D rotations, setting an upside-down up vector should cause the coordinate system to flip, which, I think does the equivalent of what the 3D handedness does. I.e. it flips the sign of the output matrix determinant. Maybe I'm missing something here? It seems like we can either do handedness here without the
up
vector or leave it as is.