[Bf-blender-cvs] [e5f7b31dd42] master: Fix VR viewer offset on session start with no positional tracking

Julian Eisel noreply at git.blender.org
Wed Mar 25 16:09:44 CET 2020


Commit: e5f7b31dd427fa72ae6b7e3e085c6b92621084a7
Author: Julian Eisel
Date:   Wed Mar 25 16:06:13 2020 +0100
Branches: master
https://developer.blender.org/rBe5f7b31dd427fa72ae6b7e3e085c6b92621084a7

Fix VR viewer offset on session start with no positional tracking

The current viewer pose position as determined by the OpenXR runtime
would be applied as offset. This offset should however only be set when
toggling the positional tracking while the session already runs.

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

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 95c0f353298..7422fc97f04 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -300,7 +300,13 @@ static void wm_xr_draw_data_populate(const wmXrSessionState *state,
 
   wm_xr_base_pose_calc(scene, settings, &r_draw_data->base_pose);
 
-  if (position_tracking_toggled || !state->is_view_data_set) {
+  /* Set the eye position offset, it's used to offset the base pose when changing positional
+   * tracking. */
+  if (!state->is_view_data_set) {
+    /* Always use the exact base pose with no offset when starting the session. */
+    copy_v3_fl(r_draw_data->eye_position_ofs, 0.0f);
+  }
+  else if (position_tracking_toggled) {
     if (use_position_tracking) {
       copy_v3_fl(r_draw_data->eye_position_ofs, 0.0f);
     }



More information about the Bf-blender-cvs mailing list