Skip to content

Commit

Permalink
openvr: smoother rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Mar 10, 2024
1 parent cb12357 commit 4679961
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/openvr/playspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ impl PlayspaceMover {
return;
}

let new_hand = Quat::from_affine3(&state.input_state.pointers[data.hand].raw_pose);
let new_hand =
Quat::from_affine3(&(data.pose * state.input_state.pointers[data.hand].raw_pose));

let dq = new_hand * data.hand_pose.conjugate();
let rel_y = f32::atan2(
Expand Down Expand Up @@ -89,7 +90,7 @@ impl PlayspaceMover {
log::warn!("Can't space rotate - failed to get zero pose");
return;
};
let hand_pose = Quat::from_affine3(&pointer.raw_pose);
let hand_pose = Quat::from_affine3(&(mat * pointer.raw_pose));
self.rotate = Some(MoverData {
pose: mat,
hand: i,
Expand Down

0 comments on commit 4679961

Please sign in to comment.