From cd14a2455b8fec8434d9fa8ae0e54f99cc57fb8b Mon Sep 17 00:00:00 2001 From: ForTehLose Date: Tue, 3 Sep 2024 15:32:04 -0400 Subject: [PATCH] added yaw to local floor --- crates/bevy_xr_utils/src/tracking_utils.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/bevy_xr_utils/src/tracking_utils.rs b/crates/bevy_xr_utils/src/tracking_utils.rs index 7bb22b0..679f3ef 100644 --- a/crates/bevy_xr_utils/src/tracking_utils.rs +++ b/crates/bevy_xr_utils/src/tracking_utils.rs @@ -171,7 +171,9 @@ fn update_local_floor_transforms( let mut calc_floor = head.clone(); calc_floor.translation.y = 0.0; //TODO: use yaw - calc_floor.rotation = Quat::IDENTITY; + let (y, x, z) = calc_floor.rotation.to_euler(EulerRot::YXZ); + let new_rot = Quat::from_rotation_y(y); + calc_floor.rotation = new_rot; for (mut transform) in &mut local_floor { *transform = calc_floor; }