diff options
Diffstat (limited to 'source/blender/windowmanager/xr')
-rw-r--r-- | source/blender/windowmanager/xr/intern/wm_xr_session.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c index f3ce7be993f..78dadbf9513 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c @@ -250,9 +250,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. - * 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); + 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: |