|
Blender V5.0
|
#include "BKE_callbacks.hh"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_main.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_string.h"#include "BLI_time.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "DNA_camera_types.h"#include "DNA_space_types.h"#include "DRW_engine.hh"#include "ED_screen.hh"#include "ED_space_api.hh"#include "GHOST_C-api.h"#include "GPU_batch.hh"#include "GPU_viewport.hh"#include "MEM_guardedalloc.h"#include "WM_api.hh"#include "WM_types.hh"#include "wm_event_system.hh"#include "wm_surface.hh"#include "wm_window.hh"#include "wm_xr_intern.hh"Go to the source code of this file.
Enumerations | |
| enum | wmXrSessionStateEvent { SESSION_STATE_EVENT_NONE = 0 , SESSION_STATE_EVENT_START , SESSION_STATE_EVENT_RESET_TO_BASE_POSE , SESSION_STATE_EVENT_POSITION_TRACKING_TOGGLE } |
Variables | |
| static wmSurface * | g_xr_surface = nullptr |
| static CLG_LogRef | LOG = {"xr"} |
| Enumerator | |
|---|---|
| SESSION_STATE_EVENT_NONE | |
| SESSION_STATE_EVENT_START | |
| SESSION_STATE_EVENT_RESET_TO_BASE_POSE | |
| SESSION_STATE_EVENT_POSITION_TRACKING_TOGGLE | |
Definition at line 274 of file wm_xr_session.cc.
| BLI_INLINE bool test_float_state | ( | const float * | state, |
| float | threshold, | ||
| eXrAxisFlag | flag ) |
Definition at line 749 of file wm_xr_session.cc.
References BLI_INLINE, fabsf, flag, state, XR_AXIS0_NEG, and XR_AXIS0_POS.
Referenced by wm_xr_session_action_states_interpret(), and wm_xr_session_action_test_bimanual().
| BLI_INLINE bool test_vec2f_state | ( | const float | state[2], |
| float | threshold, | ||
| eXrAxisFlag | flag ) |
Definition at line 769 of file wm_xr_session.cc.
References BLI_INLINE, flag, len_v2(), state, XR_AXIS0_NEG, XR_AXIS0_POS, XR_AXIS1_NEG, and XR_AXIS1_POS.
Referenced by wm_xr_session_action_states_interpret(), and wm_xr_session_action_test_bimanual().
|
static |
Definition at line 896 of file wm_xr_session.cc.
References wmXrAction::active_modal_path, wmXrAction::axis_flags, BLI_assert_unreachable, copy_v2_v2(), float, wmXrAction::float_thresholds, wmXrAction::haptic_amplitude, wmXrAction::haptic_duration, wmXrAction::haptic_flag, wmXrAction::haptic_frequency, wmXrAction::haptic_name, KM_PRESS, KM_RELEASE, wmXrAction::op_flag, state, wmXrAction::states, wmXrAction::states_prev, wmXrAction::subaction_paths, test_float_state(), test_vec2f_state(), wmXrAction::type, WM_xr_haptic_action_apply(), WM_xr_haptic_action_stop(), wm_xr_session_haptic_action_add(), wm_xr_session_haptic_action_find(), wm_xr_session_haptic_action_remove(), wm_xr_session_modal_action_remove(), wm_xr_session_modal_action_test_add(), XR_BOOLEAN_INPUT, XR_FLOAT_INPUT, XR_HAPTIC_MATCHUSERPATHS, XR_HAPTIC_PRESS, XR_HAPTIC_RELEASE, XR_HAPTIC_REPEAT, XR_OP_PRESS, XR_OP_RELEASE, XR_POSE_INPUT, XR_VECTOR2F_INPUT, and XR_VIBRATION_OUTPUT.
Referenced by wm_xr_session_events_dispatch().
|
static |
Definition at line 1047 of file wm_xr_session.cc.
References wmXrAction::action_flag, wmXrAction::axis_flags, BLI_assert_unreachable, wmXrAction::count_subaction_paths, float, wmXrAction::float_thresholds, min_ii(), state, wmXrAction::states, wmXrAction::subaction_paths, test_float_state(), test_vec2f_state(), wmXrAction::type, wm_xr_session_controller_aim_pose_find(), XR_ACTION_BIMANUAL, XR_BOOLEAN_INPUT, XR_FLOAT_INPUT, XR_POSE_INPUT, XR_VECTOR2F_INPUT, and XR_VIBRATION_OUTPUT.
Referenced by wm_xr_session_events_dispatch().
| void wm_xr_session_actions_init | ( | wmXrData * | xr | ) |
Definition at line 654 of file wm_xr_session.cc.
References wmXrRuntimeData::context, and wmXrData::runtime.
Referenced by wm_xr_session_create_cb().
| void wm_xr_session_actions_update | ( | wmWindowManager * | wm | ) |
Definition at line 1257 of file wm_xr_session.cc.
References wmXrRuntimeData::area, XrSessionSettings::base_scale, wmXrRuntimeData::context, wmXrActionSet::controller_aim_action, wmXrActionSet::controller_grip_action, ED_area_offscreen_create(), ListBase::first, mat4_to_loc_quat(), mul_m4_m4m4(), wmXrActionSet::name, View3D::object_type_exclude_select, XrSessionSettings::object_type_exclude_select, View3D::object_type_exclude_viewport, XrSessionSettings::object_type_exclude_viewport, wmXrData::runtime, wmXrData::session_settings, wmXrRuntimeData::session_state, SPACE_VIEW3D, ScrArea::spacedata, state, WM_xr_active_action_set_set(), wm_xr_pose_scale_to_imat(), wm_xr_pose_scale_to_mat(), wm_xr_session_controller_data_update(), wm_xr_session_events_dispatch(), wm_xr_session_root_window_or_fallback_get(), and wmWindowManager::xr.
Referenced by wm_xr_events_handle().
Definition at line 418 of file wm_xr_session.cc.
References wmXrRuntimeData::area, and wmXrData::runtime.
|
static |
Definition at line 183 of file wm_xr_session.cc.
References axis_angle_to_quat_single(), XrSessionSettings::base_pose_angle, XrSessionSettings::base_pose_location, XrSessionSettings::base_pose_object, XrSessionSettings::base_pose_type, XrSessionSettings::base_scale, Scene::camera, copy_v3_fl(), copy_v3_v3(), eul_to_quat(), M_PI_2, mat4_to_loc_quat(), mul_qt_qtqt(), quat_to_eul(), XR_BASE_POSE_CUSTOM, and XR_BASE_POSE_OBJECT.
Referenced by wm_xr_session_draw_data_populate().
| void WM_xr_session_base_pose_reset | ( | wmXrData * | xr | ) |
Definition at line 173 of file wm_xr_session.cc.
References wmXrSessionState::force_reset_to_base_pose, wmXrData::runtime, and wmXrRuntimeData::session_state.
|
static |
Definition at line 131 of file wm_xr_session.cc.
References wm_xr_session_create_cb(), and wm_xr_session_exit_cb().
Referenced by wm_xr_session_toggle().
|
static |
Definition at line 741 of file wm_xr_session.cc.
References BLI_findstring(), controller, offsetof, and state.
Referenced by wm_xr_session_action_test_bimanual(), and wm_xr_session_events_dispatch().
| void wm_xr_session_controller_data_clear | ( | wmXrSessionState * | state | ) |
Definition at line 1359 of file wm_xr_session.cc.
References wmXrSurfaceData::controller_art, wmXrSurfaceData::controller_draw_handle, ED_region_draw_cb_exit(), g_xr_surface, state, and wm_xr_session_controller_data_free().
Referenced by WM_xr_action_destroy(), WM_xr_action_set_destroy(), and WM_xr_active_action_set_set().
|
static |
Definition at line 80 of file wm_xr_session.cc.
References BLI_freelinkN(), BLI_pophead(), GPU_batch_discard(), and state.
Referenced by wm_xr_session_controller_data_clear(), wm_xr_session_controller_data_populate(), and wm_xr_session_data_free().
| void wm_xr_session_controller_data_populate | ( | const wmXrAction * | grip_action, |
| const wmXrAction * | aim_action, | ||
| wmXrData * | xr ) |
Definition at line 1324 of file wm_xr_session.cc.
References BLI_addtail(), BLI_assert, controller, wmXrSurfaceData::controller_art, wmXrSurfaceData::controller_draw_handle, count, wmXrAction::count_subaction_paths, ED_region_draw_cb_activate(), g_xr_surface, i, MEM_callocN(), REGION_DRAW_POST_VIEW, wmXrData::runtime, wmXrRuntimeData::session_state, state, STREQ, STRNCPY(), wmXrAction::subaction_paths, UNUSED_VARS, wm_xr_draw_controllers(), and wm_xr_session_controller_data_free().
Referenced by WM_xr_active_action_set_set(), and WM_xr_controller_pose_actions_set().
|
static |
Definition at line 686 of file wm_xr_session.cc.
References add_v3_v3(), BLI_assert, BLI_listbase_count(), controller, copy_v3_v3(), wmXrAction::count_subaction_paths, XrSessionSettings::flag, LISTBASE_FOREACH_INDEX, state, wmXrAction::states, wm_xr_pose_scale_to_mat(), wm_xr_session_controller_pose_calc(), XR_SESSION_USE_ABSOLUTE_TRACKING, XR_SESSION_USE_POSITION_TRACKING, and zero_v3().
Referenced by wm_xr_session_actions_update().
|
static |
Definition at line 663 of file wm_xr_session.cc.
References mat4_to_loc_quat(), mul_m4_m4m4(), sub_v3_v3(), and wm_xr_pose_to_mat().
Referenced by wm_xr_session_controller_data_update().
|
static |
Definition at line 55 of file wm_xr_session.cc.
References XrSessionSettings::base_scale, BKE_callback_exec_null(), BKE_CB_EVT_XR_SESSION_START_PRE, ListBase::first, G_MAIN, MEM_callocN(), wmXrData::runtime, wmXrData::session_settings, wmXrRuntimeData::session_state, state, Main::wm, wm_xr_session_actions_init(), WM_xr_session_state_navigation_reset(), WM_xr_session_state_vignette_reset(), and wmWindowManager::xr.
Referenced by wm_xr_session_begin_info_create().
| void wm_xr_session_data_free | ( | wmXrSessionState * | state | ) |
Definition at line 107 of file wm_xr_session.cc.
References state, wm_xr_session_controller_data_free(), wm_xr_session_raycast_model_free(), and wm_xr_session_vignette_data_free().
Referenced by wm_xr_runtime_data_free().
|
static |
Definition at line 1417 of file wm_xr_session.cc.
References BKE_scene_graph_evaluated_ensure(), C, CTX_data_main(), CTX_wm_manager(), depsgraph, WM_xr_session_is_ready(), wm_xr_session_scene_and_depsgraph_get(), and wmWindowManager::xr.
Referenced by wm_xr_session_surface_create().
|
static |
Definition at line 281 of file wm_xr_session.cc.
References XrSessionSettings::base_pose_object, XrSessionSettings::base_pose_type, XrSessionSettings::flag, state, and XR_SESSION_USE_POSITION_TRACKING.
Referenced by wm_xr_session_state_to_event().
|
static |
Definition at line 221 of file wm_xr_session.cc.
References wmXrDrawData::base_pose, wmXrDrawData::base_scale, depsgraph, wmXrDrawData::depsgraph, g_xr_surface, wmXrDrawData::scene, wmXrData::session_settings, wmXrDrawData::surface_data, wm_xr_session_base_pose_calc(), and wmXrDrawData::xr_data.
Referenced by wm_xr_session_surface_draw().
| void wm_xr_session_draw_data_update | ( | wmXrSessionState * | state, |
| const XrSessionSettings * | settings, | ||
| const GHOST_XrDrawViewInfo * | draw_view, | ||
| wmXrDrawData * | draw_data ) |
Definition at line 312 of file wm_xr_session.cc.
References copy_v3_fl(), copy_v3_v3(), wmXrDrawData::eye_position_ofs, XrSessionSettings::flag, SESSION_STATE_EVENT_NONE, SESSION_STATE_EVENT_POSITION_TRACKING_TOGGLE, SESSION_STATE_EVENT_RESET_TO_BASE_POSE, SESSION_STATE_EVENT_START, state, WM_xr_session_state_navigation_reset(), wm_xr_session_state_to_event(), and XR_SESSION_USE_POSITION_TRACKING.
Referenced by wm_xr_draw_view().
|
static |
Definition at line 1105 of file wm_xr_session.cc.
References BLI_assert_unreachable, copy_qt_qt(), copy_v2_v2(), copy_v3_v3(), data, float, wmXrAction::float_thresholds, MEM_callocN(), wmXrAction::name, wmXrAction::op_properties, wmXrAction::ot, wmXrAction::states, STRNCPY(), wmXrAction::subaction_paths, wmXrAction::type, XR_BOOLEAN_INPUT, XR_FLOAT_INPUT, XR_POSE_INPUT, XR_VECTOR2F_INPUT, and XR_VIBRATION_OUTPUT.
Referenced by wm_xr_session_events_dispatch().
|
static |
Definition at line 1175 of file wm_xr_session.cc.
References wmXrActionSet::active_haptic_actions, wmXrActionSet::active_modal_actions, wmXrAction::active_modal_path, BLI_time_now_seconds(), count, wmXrAction::count_subaction_paths, wmXrAction::haptic_name, KM_NOTHING, MEM_calloc_arrayN(), MEM_freeN(), wmOperatorType::modal, wmXrActionSet::name, wmXrAction::ot, wmXrAction::subaction_paths, wm_xr_session_action_states_interpret(), wm_xr_session_action_test_bimanual(), wm_xr_session_controller_aim_pose_find(), wm_xr_session_event_create(), wm_xr_session_haptic_timers_check(), and wm_xr_session_modal_action_test().
Referenced by wm_xr_session_actions_update().
| bool WM_xr_session_exists | ( | const wmXrData * | xr | ) |
Definition at line 168 of file wm_xr_session.cc.
References wmXrRuntimeData::context, wmXrSessionState::is_started, wmXrData::runtime, and wmXrRuntimeData::session_state.
Referenced by WM_xr_session_is_ready(), WM_xr_session_state_nav_location_set(), WM_xr_session_state_nav_rotation_set(), WM_xr_session_state_nav_scale_set(), WM_xr_session_state_vignette_activate(), wm_xr_session_toggle(), and wm_xr_session_update_screen().
|
static |
Definition at line 114 of file wm_xr_session.cc.
References wmXrRuntimeData::exit_fn, wmXrSessionState::is_started, wmXrData::runtime, wmXrRuntimeData::session_state, and wm_xr_runtime_data_free().
Referenced by wm_xr_session_begin_info_create().
| void * wm_xr_session_gpu_binding_context_create | ( | ) |
Definition at line 1562 of file wm_xr_session.cc.
References NC_WM, ND_XR_DATA_CHANGED, wmSurface::system_gpu_context, WM_main_add_notifier(), wm_surface_add(), and wm_xr_session_surface_create().
Referenced by wm_xr_init().
| void wm_xr_session_gpu_binding_context_destroy | ( | GHOST_ContextHandle | context | ) |
Definition at line 1575 of file wm_xr_session.cc.
References g_xr_surface, NC_WM, ND_XR_DATA_CHANGED, WM_main_add_notifier(), wm_surface_remove(), and wm_window_reset_drawable().
Referenced by wm_xr_init().
|
static |
Definition at line 856 of file wm_xr_session.cc.
References wmXrHapticAction::action, BLI_addtail(), MEM_callocN(), wmXrHapticAction::subaction_path, wmXrHapticAction::time_start, and wm_xr_session_haptic_action_find().
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 844 of file wm_xr_session.cc.
References LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret(), and wm_xr_session_haptic_action_add().
|
static |
Definition at line 876 of file wm_xr_session.cc.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 887 of file wm_xr_session.cc.
References BLI_freelinkN(), and LISTBASE_FOREACH_MUTABLE.
Referenced by wm_xr_session_events_dispatch().
| bool WM_xr_session_is_ready | ( | const wmXrData * | xr | ) |
Definition at line 178 of file wm_xr_session.cc.
References wmXrRuntimeData::context, wmXrData::runtime, and WM_xr_session_exists().
Referenced by wm_xr_draw_view(), wm_xr_events_handle(), wm_xr_operator_sessionactive(), wm_xr_session_do_depsgraph(), WM_xr_session_state_controller_aim_location_get(), WM_xr_session_state_controller_aim_rotation_get(), WM_xr_session_state_controller_grip_location_get(), WM_xr_session_state_controller_grip_rotation_get(), WM_xr_session_state_nav_location_get(), WM_xr_session_state_nav_rotation_get(), WM_xr_session_state_nav_scale_get(), WM_xr_session_state_viewer_pose_location_get(), WM_xr_session_state_viewer_pose_matrix_info_get(), WM_xr_session_state_viewer_pose_rotation_get(), and wm_xr_session_surface_draw().
|
static |
Definition at line 833 of file wm_xr_session.cc.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 794 of file wm_xr_session.cc.
References IDP_EqualsProperties(), LISTBASE_FOREACH, wmXrAction::op_properties, and wmXrAction::ot.
Referenced by wm_xr_session_events_dispatch(), and wm_xr_session_modal_action_test_add().
|
static |
Definition at line 822 of file wm_xr_session.cc.
References BLI_addtail(), LinkData::data, MEM_callocN(), and wm_xr_session_modal_action_test().
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 99 of file wm_xr_session.cc.
References GPU_batch_discard(), and state.
Referenced by wm_xr_session_data_free().
| wmWindow * wm_xr_session_root_window_or_fallback_get | ( | const wmWindowManager * | wm, |
| const wmXrRuntimeData * | runtime_data ) |
Definition at line 238 of file wm_xr_session.cc.
References BLI_findindex(), ListBase::first, wmXrRuntimeData::session_root_win, and wmWindowManager::windows.
Referenced by wm_xr_runtime_data_free(), wm_xr_session_actions_update(), and wm_xr_session_scene_and_depsgraph_get().
|
static |
Get the scene and depsgraph shown in the VR session's root window (the window the session was started from) if still available. If it's not available, use some fallback window.
It's important that the VR session follows some existing window, otherwise it would need to have its own depsgraph, which is an expense we should avoid.
Definition at line 258 of file wm_xr_session.cc.
References BKE_scene_get_depsgraph(), BLI_assert, depsgraph, wmXrData::runtime, WM_window_get_active_scene(), WM_window_get_active_view_layer(), wm_xr_session_root_window_or_fallback_get(), and wmWindowManager::xr.
Referenced by wm_xr_session_do_depsgraph(), and wm_xr_session_surface_draw().
| bool WM_xr_session_state_controller_aim_location_get | ( | const wmXrData * | xr, |
| uint | subaction_idx, | ||
| float | r_location[3] ) |
Definition at line 497 of file wm_xr_session.cc.
References BLI_assert, BLI_findlink(), BLI_listbase_count(), controller, wmXrSessionState::controllers, copy_v3_v3(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, WM_xr_session_is_ready(), and zero_v3().
| bool WM_xr_session_state_controller_aim_rotation_get | ( | const wmXrData * | xr, |
| uint | subaction_idx, | ||
| float | r_rotation[4] ) |
Definition at line 515 of file wm_xr_session.cc.
References BLI_assert, BLI_findlink(), BLI_listbase_count(), controller, wmXrSessionState::controllers, copy_qt_qt(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, unit_qt(), and WM_xr_session_is_ready().
| bool WM_xr_session_state_controller_grip_location_get | ( | const wmXrData * | xr, |
| uint | subaction_idx, | ||
| float | r_location[3] ) |
Definition at line 461 of file wm_xr_session.cc.
References BLI_assert, BLI_findlink(), BLI_listbase_count(), controller, wmXrSessionState::controllers, copy_v3_v3(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, WM_xr_session_is_ready(), and zero_v3().
| bool WM_xr_session_state_controller_grip_rotation_get | ( | const wmXrData * | xr, |
| uint | subaction_idx, | ||
| float | r_rotation[4] ) |
Definition at line 479 of file wm_xr_session.cc.
References BLI_assert, BLI_findlink(), BLI_listbase_count(), controller, wmXrSessionState::controllers, copy_qt_qt(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, unit_qt(), and WM_xr_session_is_ready().
| wmXrSessionState * WM_xr_session_state_handle_get | ( | const wmXrData * | xr | ) |
Definition at line 413 of file wm_xr_session.cc.
References wmXrData::runtime, and wmXrRuntimeData::session_state.
Definition at line 533 of file wm_xr_session.cc.
References copy_v3_v3(), wmXrSessionState::is_view_data_set, wmXrSessionState::nav_pose, wmXrData::runtime, wmXrRuntimeData::session_state, WM_xr_session_is_ready(), and zero_v3().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), wm_xr_navigation_reset_exec(), and wm_xr_navigation_teleport_pose_calc().
Definition at line 544 of file wm_xr_session.cc.
References copy_v3_v3(), wmXrSessionState::is_navigation_dirty, wmXrSessionState::nav_pose, wmXrData::runtime, wmXrRuntimeData::session_state, and WM_xr_session_exists().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), wm_xr_navigation_reset_exec(), and wm_xr_navigation_teleport_modal().
Definition at line 552 of file wm_xr_session.cc.
References copy_qt_qt(), wmXrSessionState::is_view_data_set, wmXrSessionState::nav_pose, wmXrData::runtime, wmXrRuntimeData::session_state, unit_qt(), and WM_xr_session_is_ready().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), wm_xr_navigation_reset_exec(), and wm_xr_navigation_teleport_pose_calc().
Definition at line 563 of file wm_xr_session.cc.
References BLI_ASSERT_UNIT_QUAT, copy_qt_qt(), wmXrSessionState::is_navigation_dirty, wmXrSessionState::nav_pose, wmXrData::runtime, wmXrRuntimeData::session_state, and WM_xr_session_exists().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), and wm_xr_navigation_reset_exec().
Definition at line 572 of file wm_xr_session.cc.
References wmXrSessionState::is_view_data_set, wmXrSessionState::nav_scale, wmXrData::runtime, wmXrRuntimeData::session_state, and WM_xr_session_is_ready().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), wm_xr_navigation_reset_exec(), wm_xr_navigation_teleport_modal(), and wm_xr_raycast_update().
Definition at line 583 of file wm_xr_session.cc.
References CLAMP, XrSessionSettings::clip_end, XrSessionSettings::clip_start, wmXrSessionState::is_navigation_dirty, wmXrSessionState::nav_scale, wmXrData::runtime, wmXrData::session_settings, wmXrRuntimeData::session_state, and WM_xr_session_exists().
Referenced by wm_xr_navigation_grab_apply(), and wm_xr_navigation_reset_exec().
| void WM_xr_session_state_navigation_reset | ( | wmXrSessionState * | state | ) |
Definition at line 593 of file wm_xr_session.cc.
References state, unit_qt(), and zero_v3().
Referenced by wm_xr_session_create_cb(), and wm_xr_session_draw_data_update().
|
static |
Definition at line 292 of file wm_xr_session.cc.
References XrSessionSettings::flag, SESSION_STATE_EVENT_NONE, SESSION_STATE_EVENT_POSITION_TRACKING_TOGGLE, SESSION_STATE_EVENT_RESET_TO_BASE_POSE, SESSION_STATE_EVENT_START, state, wm_xr_session_draw_data_needs_reset_to_base_pose(), and XR_SESSION_USE_POSITION_TRACKING.
Referenced by wm_xr_session_draw_data_update().
| void wm_xr_session_state_update | ( | const XrSessionSettings * | settings, |
| const wmXrDrawData * | draw_data, | ||
| const GHOST_XrDrawViewInfo * | draw_view, | ||
| wmXrSessionState * | state ) |
Update information that is only stored for external state queries. E.g. for Python API to request the current (as in, last known) viewer pose. Controller data and action sets will be updated separately via wm_xr_session_actions_update().
Definition at line 360 of file wm_xr_session.cc.
References wmXrDrawData::base_pose, XrSessionSettings::base_pose_object, XrSessionSettings::base_pose_type, wmXrDrawData::base_scale, copy_qt_qt(), copy_v3_v3(), DEFAULT_SENSOR_WIDTH, wmXrDrawData::eye_position_ofs, XrSessionSettings::flag, fov_to_focallength(), mat4_to_loc_quat(), mul_m4_m4m4(), state, sub_v3_v3(), wm_xr_pose_scale_to_imat(), wm_xr_pose_scale_to_mat(), wm_xr_pose_to_mat(), WM_xr_session_state_vignette_update(), XR_SESSION_USE_ABSOLUTE_TRACKING, XR_SESSION_USE_POSITION_TRACKING, and zero_v3().
Referenced by wm_xr_draw_view().
Definition at line 423 of file wm_xr_session.cc.
References copy_v3_v3(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, wmXrSessionState::viewer_pose, WM_xr_session_is_ready(), and zero_v3().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_navigation_teleport_pose_calc(), and wm_xr_raycast_update().
| bool WM_xr_session_state_viewer_pose_matrix_info_get | ( | const wmXrData * | xr, |
| float | r_viewmat[4][4], | ||
| float * | r_focal_len ) |
Definition at line 445 of file wm_xr_session.cc.
References copy_m4_m4(), wmXrSessionState::focal_len, wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, unit_m4(), wmXrSessionState::viewer_viewmat, and WM_xr_session_is_ready().
Definition at line 434 of file wm_xr_session.cc.
References copy_v4_v4(), wmXrSessionState::is_view_data_set, wmXrData::runtime, wmXrRuntimeData::session_state, unit_qt(), wmXrSessionState::viewer_pose, and WM_xr_session_is_ready().
Referenced by wm_xr_fly_init(), wm_xr_navigation_fly_modal(), and wm_xr_raycast_update().
| void WM_xr_session_state_vignette_activate | ( | wmXrData * | xr | ) |
Definition at line 621 of file wm_xr_session.cc.
References data, min_ff(), wmXrData::runtime, wmXrRuntimeData::session_state, wmXrSessionState::vignette_data, and WM_xr_session_exists().
Referenced by wm_xr_navigation_fly_modal(), and wm_xr_navigation_grab_modal().
| void WM_xr_session_state_vignette_reset | ( | wmXrSessionState * | state | ) |
Definition at line 602 of file wm_xr_session.cc.
Referenced by wm_xr_session_create_cb().
| void WM_xr_session_state_vignette_update | ( | wmXrSessionState * | state | ) |
Definition at line 630 of file wm_xr_session.cc.
References clamp_f(), data, interpf(), min_ff(), state, and U.
Referenced by wm_xr_session_state_update().
|
static |
Definition at line 1534 of file wm_xr_session.cc.
References wmSurface::activate, wmSurface::blender_gpu_context, BLI_assert, wmSurface::customdata, data, wmSurface::deactivate, wmSurface::do_depsgraph, wmSurface::draw, wmSurface::free_data, g_xr_surface, MEM_callocN(), RGN_TYPE_XR, wmSurface::system_gpu_context, wm_xr_session_do_depsgraph(), wm_xr_session_surface_draw(), and wm_xr_session_surface_free_data().
Referenced by wm_xr_session_gpu_binding_context_create().
|
static |
Call Ghost-XR to draw a frame.
Draw callback for the XR-session surface. It's expected to be called on each main loop iteration and tells Ghost-XR to submit a new frame by drawing its views. Note that for drawing each view, wm_xr_draw_view() will be called through Ghost-XR (see GHOST_XrDrawViewFunc()).
Definition at line 1392 of file wm_xr_session.cc.
References C, wmXrRuntimeData::context, CTX_wm_manager(), depsgraph, GPU_framebuffer_active_get(), GPU_framebuffer_restore(), wmXrData::runtime, wm_xr_session_draw_data_populate(), WM_xr_session_is_ready(), wm_xr_session_scene_and_depsgraph_get(), and wmWindowManager::xr.
Referenced by wm_xr_session_surface_create().
|
static |
Definition at line 1509 of file wm_xr_session.cc.
References BLI_freelinkN(), BLI_freelistN(), BLI_pophead(), wmSurface::customdata, data, g_xr_surface, GPU_offscreen_free(), GPU_viewport_free(), and MEM_freeN().
Referenced by wm_xr_session_surface_create().
| bool wm_xr_session_surface_offscreen_ensure | ( | wmXrSurfaceData * | surface_data, |
| const GHOST_XrDrawViewInfo * | draw_view ) |
Definition at line 1431 of file wm_xr_session.cc.
References BLI_addtail(), BLI_assert, BLI_findlink(), BLI_listbase_count(), CLOG_ERROR, GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_height(), GPU_offscreen_width(), GPU_TEXTURE_USAGE_MEMORY_EXPORT, GPU_TEXTURE_USAGE_SHADER_READ, GPU_viewport_create(), GPU_viewport_free(), LOG, MEM_callocN(), wmXrViewportPair::offscreen, wmXrViewportPair::viewport, and wmXrSurfaceData::viewports.
Referenced by wm_xr_draw_view().
| void wm_xr_session_toggle | ( | wmWindowManager * | wm, |
| wmWindow * | session_root_win, | ||
| wmXrSessionExitFn | session_exit_fn ) |
Definition at line 144 of file wm_xr_session.cc.
References wmXrRuntimeData::context, wmXrRuntimeData::exit_fn, wmXrSessionState::is_started, wmXrData::runtime, wmXrRuntimeData::session_root_win, wmXrRuntimeData::session_state, wm_xr_session_begin_info_create(), WM_xr_session_exists(), and wmWindowManager::xr.
Referenced by wm_xr_session_toggle_exec().
|
static |
Definition at line 91 of file wm_xr_session.cc.
References MEM_freeN(), and state.
Referenced by wm_xr_session_data_free().
| ARegionType * WM_xr_surface_controller_region_type_get | ( | ) |
Definition at line 1588 of file wm_xr_session.cc.
References data, and g_xr_surface.
Referenced by drw_callbacks_post_scene().
Definition at line 50 of file wm_xr_session.cc.
Referenced by wm_xr_session_controller_data_clear(), wm_xr_session_controller_data_populate(), wm_xr_session_draw_data_populate(), wm_xr_session_gpu_binding_context_destroy(), wm_xr_session_surface_create(), wm_xr_session_surface_free_data(), and WM_xr_surface_controller_region_type_get().
|
static |
Definition at line 51 of file wm_xr_session.cc.