mirror of https://github.com/wayvr-org/wayvr.git
fix space rotate
the change in rotation is computed in the untransformed stage space. To produce the correct rotation change the quaternion needs to be rotated using the space offset
This commit is contained in:
parent
ed1d708802
commit
c7b16c5713
|
|
@ -82,10 +82,11 @@ impl PlayspaceMover {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let pose_quat = Quat::from_affine3(&data.pose);
|
||||||
let new_hand =
|
let new_hand =
|
||||||
Quat::from_affine3(&(data.pose * app.input_state.pointers[data.hand].raw_pose));
|
pose_quat * Quat::from_affine3(&app.input_state.pointers[data.hand].raw_pose);
|
||||||
|
|
||||||
let dq = new_hand * data.hand_pose.conjugate();
|
let dq = pose_quat.conjugate() * (new_hand * data.hand_pose.conjugate()) * pose_quat;
|
||||||
let mut space_transform = if app.session.config.space_rotate_unlocked {
|
let mut space_transform = if app.session.config.space_rotate_unlocked {
|
||||||
Affine3A::from_quat(dq)
|
Affine3A::from_quat(dq)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue