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
cdd658d4ea
commit
e4a85074a3
|
|
@ -88,10 +88,11 @@ impl PlayspaceMover {
|
|||
return;
|
||||
}
|
||||
|
||||
let pose_quat = Quat::from_affine3(&data.pose);
|
||||
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 {
|
||||
Affine3A::from_quat(dq)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue