[Bf-blender-cvs] [763eb3d016f] vr_scene_inspection: Only use Z-axis rotation for base pose (grid aligned)

Julian Eisel noreply at git.blender.org
Sat Feb 15 01:07:55 CET 2020


Commit: 763eb3d016fdfe7b6bcbc26a710ab96ee4b28051
Author: Julian Eisel
Date:   Fri Feb 14 23:24:13 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rB763eb3d016fdfe7b6bcbc26a710ab96ee4b28051

Only use Z-axis rotation for base pose (grid aligned)

===================================================================

M	source/blender/windowmanager/intern/wm_xr.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c
index 7b959719729..7c2bbc8902f 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -232,7 +232,12 @@ static void wm_xr_runtime_session_state_update(bXrRuntimeSessionState *state,
     copy_v3_v3(state->final_reference_pose.position, state->reference_pose.position);
   }
 
-  copy_v4_v4(state->final_reference_pose.orientation_quat, state->reference_pose.orientation_quat);
+  float tmp_eul[3];
+  /* Only use rotation around Z-axis to align view with floor. */
+  quat_to_eul(tmp_eul, state->reference_pose.orientation_quat);
+  tmp_eul[0] = M_PI_2;
+  tmp_eul[1] = 0;
+  eul_to_quat(state->final_reference_pose.orientation_quat, tmp_eul);
 
   if (position_tracking_toggled) {
     copy_v3_v3(state->final_reference_pose.position, state->reference_pose.position);



More information about the Bf-blender-cvs mailing list