From fdb7ace47a4243cf368e7948c5dcb1b3d9a3666d Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Fri, 5 Jun 2026 21:19:46 +0200 Subject: [PATCH] Revert "WIP snapping" This reverts commit 11d166d518b4aafc9513d47d3ea1214c9f391255. --- client/scenes/stream.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index b30e395a..f01036ab 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -21,8 +21,6 @@ #include "xr/face_tracker.h" #include "xr/fb_face_tracker2.h" #include "xr/space.h" -#include -#include #include #include #include @@ -739,30 +737,6 @@ void scenes::stream::update_gui_position(xr::spaces controller, float predicted_ world_gui_position = world_controller_position + world_controller_orientation * controller_gui_position; world_gui_orientation = world_controller_orientation * controller_gui_orientation; - - if ((world_gui_orientation * glm::vec3(0, 1, 0)).y > 0.985) - { - glm::mat3 M = glm::mat3_cast(world_gui_orientation); - - // Snap the Y axis of the GUI layer to the Y axis of the world frame - M[1] = glm::vec3(0, 1, 0); - - // Re-orthonormalize the matrix - M[0] = M[0] - glm::dot(M[0], M[1]) * M[1]; - M[0] = M[0] / glm::length(M[0]); - - // M[2] = M[2] - glm::dot(M[2], M[1]) * M[1]; - // M[2] = M[2] / glm::length(M[2]); - M[2] = glm::cross(M[0], M[1]); - - world_gui_orientation = glm::quat_cast(M); - } - - if (std::abs(world_gui_orientation.z) < 0.1) - { - world_gui_orientation.z = 0; - world_gui_orientation = glm::normalize(world_gui_orientation); - } } }