[Bf-blender-cvs] [ab3a6515156] blender-v2.90-release: Fix offset applied on top of VR landmark with no positional tracking

Julian Eisel noreply at git.blender.org
Fri Aug 14 13:29:43 CEST 2020


Commit: ab3a65151568d4f0cb0ac5747dd074cd8697c1d8
Author: Julian Eisel
Date:   Fri Aug 14 13:17:05 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBab3a65151568d4f0cb0ac5747dd074cd8697c1d8

Fix offset applied on top of VR landmark with no positional tracking

On VR session start with positional tracking disabled, the pose would
have an offset applied but it was supposed to start exactly at the
landmark position.

Issue is that we applied the offset to cancel out the position offset
reported by the OpenXR runtime incorrectly. We only want to do that if
positional tracking is enabled, because if not we don't even apply the
runtime's position offset. So we'd cancel something out that wasn't
there.

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

M	source/blender/windowmanager/xr/intern/wm_xr_session.c

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

diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c
index 9c6b8e8fbda..4edfd53c37a 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_session.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c
@@ -251,9 +251,14 @@ void wm_xr_session_draw_data_update(const wmXrSessionState *state,
 
   switch (event) {
     case SESSION_STATE_EVENT_START:
-      /* We want to start the session exactly at landmark position. Runtimes may have a non-[0,0,0]
-       * starting position that we have to substract for that. */
-      copy_v3_v3(draw_data->eye_position_ofs, draw_view->local_pose.position);
+      if (use_position_tracking) {
+        /* We want to start the session exactly at landmark position.
+         * Run-times may have a non-[0,0,0] starting position that we have to subtract for that. */
+        copy_v3_v3(draw_data->eye_position_ofs, draw_view->local_pose.position);
+      }
+      else {
+        copy_v3_fl(draw_data->eye_position_ofs, 0.0f);
+      }
       break;
       /* This should be triggered by the VR add-on if a landmark changes. */
     case SESSION_STATE_EVENT_RESET_TO_BASE_POSE:



More information about the Bf-blender-cvs mailing list