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:
Snemby 2026-05-11 18:19:13 +02:00 committed by galister
parent ed1d708802
commit c7b16c5713
1 changed files with 3 additions and 2 deletions

View File

@ -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 {