diff options
Diffstat (limited to 'source/blender/windowmanager/xr/intern/wm_xr_session.c')
-rw-r--r-- | source/blender/windowmanager/xr/intern/wm_xr_session.c | 13 |
1 files changed, 9 insertions, 4 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..b9ef40e3398 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c @@ -195,7 +195,7 @@ static void wm_xr_session_scene_and_evaluated_depsgraph_get(Main *bmain, Scene *scene = WM_window_get_active_scene(root_win); ViewLayer *view_layer = WM_window_get_active_view_layer(root_win); - Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, false); + Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer); BLI_assert(scene && view_layer && depsgraph); BKE_scene_graph_evaluated_ensure(depsgraph, bmain); *r_scene = scene; @@ -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: |