|
Blender V4.3
|
#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 = {"wm.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 252 of file wm_xr_session.cc.
| BLI_INLINE bool test_float_state | ( | const float * | state, |
| float | threshold, | ||
| eXrAxisFlag | flag ) |
Definition at line 679 of file wm_xr_session.cc.
References 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 699 of file wm_xr_session.cc.
References 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 826 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 977 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 584 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 1189 of file wm_xr_session.cc.
References wmXrRuntimeData::area, 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, View3D::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 394 of file wm_xr_session.cc.
References wmXrRuntimeData::area, and wmXrData::runtime.
|
static |
Definition at line 161 of file wm_xr_session.cc.
References axis_angle_to_quat_single(), 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 151 of file wm_xr_session.cc.
References wmXrSessionState::force_reset_to_base_pose, wmXrData::runtime, and wmXrRuntimeData::session_state.
|
static |
Definition at line 109 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 671 of file wm_xr_session.cc.
References wmXrController::aim_pose, 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 1292 of file wm_xr_session.cc.
References wmXrSurfaceData::controller_art, wmXrSurfaceData::controller_draw_handle, wmSurface::customdata, 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 76 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 1256 of file wm_xr_session.cc.
References BLI_addtail(), BLI_assert, controller, wmXrSurfaceData::controller_art, wmXrSurfaceData::controller_draw_handle, count, wmXrAction::count_subaction_paths, wmSurface::customdata, ED_region_draw_cb_activate(), g_xr_surface, 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 616 of file wm_xr_session.cc.
References add_v3_v3(), BLI_assert, BLI_listbase_count(), controller, copy_v3_v3(), wmXrAction::count_subaction_paths, 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 593 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 BKE_callback_exec_null(), BKE_CB_EVT_XR_SESSION_START_PRE, ListBase::first, G_MAIN, wmXrData::runtime, wmXrData::session_settings, wmXrRuntimeData::session_state, state, Main::wm, wm_xr_session_actions_init(), WM_xr_session_state_navigation_reset(), and wmWindowManager::xr.
Referenced by wm_xr_session_begin_info_create().
| void wm_xr_session_data_free | ( | wmXrSessionState * | state | ) |
Definition at line 87 of file wm_xr_session.cc.
References state, and wm_xr_session_controller_data_free().
Referenced by wm_xr_runtime_data_free().
|
static |
Definition at line 1350 of file wm_xr_session.cc.
References BKE_scene_graph_evaluated_ensure(), CTX_data_main(), CTX_wm_manager(), depsgraph, scene, 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 259 of file wm_xr_session.cc.
References state, and XR_SESSION_USE_POSITION_TRACKING.
Referenced by wm_xr_session_state_to_event().
|
static |
Definition at line 199 of file wm_xr_session.cc.
References wmXrDrawData::base_pose, wmXrDrawData::base_scale, wmSurface::customdata, depsgraph, wmXrDrawData::depsgraph, g_xr_surface, scene, 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 290 of file wm_xr_session.cc.
References copy_v3_fl(), copy_v3_v3(), draw_view, wmXrDrawData::eye_position_ofs, 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 1035 of file wm_xr_session.cc.
References BLI_assert_unreachable, copy_qt_qt(), copy_v2_v2(), copy_v3_v3(), data, 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 1106 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 146 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_toggle(), and wm_xr_session_update_screen().
|
static |
Definition at line 92 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 1491 of file wm_xr_session.cc.
References NC_WM, ND_XR_DATA_CHANGED, 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 1504 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 786 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 774 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 806 of file wm_xr_session.cc.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 817 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 156 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 763 of file wm_xr_session.cc.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 724 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 752 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().
| wmWindow * wm_xr_session_root_window_or_fallback_get | ( | const wmWindowManager * | wm, |
| const wmXrRuntimeData * | runtime_data ) |
Definition at line 216 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 236 of file wm_xr_session.cc.
References BKE_scene_get_depsgraph(), BLI_assert, depsgraph, wmXrData::runtime, scene, 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 473 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 491 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 437 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 455 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 389 of file wm_xr_session.cc.
References wmXrData::runtime, and wmXrRuntimeData::session_state.
Definition at line 509 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().
Definition at line 520 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().
Definition at line 528 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().
Definition at line 539 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 548 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(), and wm_xr_navigation_reset_exec().
Definition at line 559 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 569 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 270 of file wm_xr_session.cc.
References 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 338 of file wm_xr_session.cc.
References wmXrDrawData::base_pose, wmXrDrawData::base_scale, copy_qt_qt(), copy_v3_v3(), DEFAULT_SENSOR_WIDTH, draw_view, wmXrDrawData::eye_position_ofs, 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(), XR_SESSION_USE_ABSOLUTE_TRACKING, XR_SESSION_USE_POSITION_TRACKING, and zero_v3().
Referenced by wm_xr_draw_view().
Definition at line 399 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(), 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 421 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 410 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().
|
static |
Definition at line 1461 of file wm_xr_session.cc.
References BLI_assert, wmXrSurfaceData::controller_art, data, ARegionType::draw, g_xr_surface, MEM_callocN, RGN_TYPE_XR, 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 1325 of file wm_xr_session.cc.
References wmXrRuntimeData::context, CTX_wm_manager(), depsgraph, GPU_framebuffer_active_get(), GPU_framebuffer_restore(), wmXrData::runtime, scene, 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 1436 of file wm_xr_session.cc.
References BLI_freelinkN(), BLI_freelistN(), BLI_pophead(), 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 1364 of file wm_xr_session.cc.
References BLI_addtail(), BLI_assert, BLI_findlink(), BLI_listbase_count(), CLOG_ERROR, draw_view, GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_height(), GPU_offscreen_width(), GPU_R8, GPU_RGB10_A2, GPU_RGBA16, GPU_RGBA16F, GPU_RGBA8, 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 122 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().
| ARegionType * WM_xr_surface_controller_region_type_get | ( | ) |
Definition at line 1517 of file wm_xr_session.cc.
References wmXrSurfaceData::controller_art, wmSurface::customdata, and g_xr_surface.
Referenced by DRW_draw_callbacks_post_scene().
|
static |
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.
Referenced by wm_xr_session_surface_offscreen_ensure().