From 67877d6a5f34a386fa0766b19103612c9e034c73 Mon Sep 17 00:00:00 2001 From: cubee Date: Tue, 28 Jul 2026 17:48:47 +1000 Subject: [PATCH] make other `shift_world` obey `space_drag_affects_world`, and overlays follow `space-rotate` --- wayvr/src/backend/openvr/playspace.rs | 12 ++++++++++-- wayvr/src/backend/openxr/playspace.rs | 21 ++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/wayvr/src/backend/openvr/playspace.rs b/wayvr/src/backend/openvr/playspace.rs index 67568160..9290eaf1 100644 --- a/wayvr/src/backend/openvr/playspace.rs +++ b/wayvr/src/backend/openvr/playspace.rs @@ -95,7 +95,11 @@ impl PlayspaceMover { * -1.0; space_transform.translation = offset; + let before_pose = data.pose; data.pose *= space_transform; + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, &mut app.anchor, &before_pose, &data.pose); + } data.hand_pose = new_hand; if self.universe == ETrackingUniverseOrigin::TrackingUniverseStanding { @@ -243,7 +247,9 @@ impl PlayspaceMover { set_working_copy(&self.universe, chaperone_mgr, &mat); chaperone_mgr.commit_working_copy(EChaperoneConfigFile::EChaperoneConfigFile_Live); - playspace_common::shift_world(overlays, anchor, &before, &mat); + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, anchor, &before, &mat); + } if self.drag.is_some() { log::info!("Space drag interrupted by fix floor"); @@ -314,7 +320,9 @@ impl PlayspaceMover { set_working_copy(&self.universe, chaperone_mgr, &new_mat); chaperone_mgr.commit_working_copy(EChaperoneConfigFile::EChaperoneConfigFile_Live); - playspace_common::shift_world(overlays, anchor, &before, &new_mat); + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, anchor, &before, &new_mat); + } } pub fn playspace_changed( diff --git a/wayvr/src/backend/openxr/playspace.rs b/wayvr/src/backend/openxr/playspace.rs index 106165a1..d34c96db 100644 --- a/wayvr/src/backend/openxr/playspace.rs +++ b/wayvr/src/backend/openxr/playspace.rs @@ -114,7 +114,11 @@ impl PlayspaceMover { space_transform.translation = offset; + let before_pose = data.pose; data.pose *= space_transform; + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, &mut app.anchor, &before_pose, &data.pose); + } data.hand_pose = new_hand; apply_offset(data.pose, &mut monado.ipc); @@ -228,7 +232,9 @@ impl PlayspaceMover { let after_pose = Affine3A::from_translation(res.playspace_pos.into()); apply_offset(after_pose, &mut monado.ipc); - playspace_common::shift_world(overlays, &mut app.anchor, &before_pose, &after_pose); + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, &mut app.anchor, &before_pose, &after_pose); + } } } @@ -300,9 +306,11 @@ impl PlayspaceMover { self.gravity.reset(); - let after = - Affine3A::from_rotation_translation(pose.orientation.into(), pose.position.into()); - playspace_common::shift_world(overlays, anchor, &before, &after); + if !app.session.config.space_drag_affects_world { + let after = + Affine3A::from_rotation_translation(pose.orientation.into(), pose.position.into()); + playspace_common::shift_world(overlays, anchor, &before, &after); + } } pub fn reset_offset( @@ -391,7 +399,10 @@ impl PlayspaceMover { let after = Affine3A::from_rotation_translation(pose.orientation.into(), pose.position.into()); - playspace_common::shift_world(overlays, anchor, &before, &after); + + if !app.session.config.space_drag_affects_world { + playspace_common::shift_world(overlays, anchor, &before, &after); + } } pub fn save_center(&mut self, monado: &mut Monado) {