Blender
V3.3
|
#include "BKE_callbacks.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_main.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "DNA_camera_types.h"
#include "DNA_space_types.h"
#include "DRW_engine.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "GHOST_C-api.h"
#include "GPU_batch.h"
#include "GPU_viewport.h"
#include "MEM_guardedalloc.h"
#include "PIL_time.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm_event_system.h"
#include "wm_surface.h"
#include "wm_window.h"
#include "wm_xr_intern.h"
Go to the source code of this file.
Typedefs | |
typedef enum wmXrSessionStateEvent | wmXrSessionStateEvent |
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 = NULL |
static CLG_LogRef | LOG = {"wm.xr"} |
typedef enum wmXrSessionStateEvent wmXrSessionStateEvent |
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 249 of file wm_xr_session.c.
BLI_INLINE bool test_float_state | ( | const float * | state, |
float | threshold, | ||
eXrAxisFlag | flag | ||
) |
Definition at line 670 of file wm_xr_session.c.
References fabsf, state, threshold, 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 690 of file wm_xr_session.c.
References len_v2(), state, threshold, 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 816 of file wm_xr_session.c.
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, NULL, wmXrAction::op_flag, blender::meshintersect::prev(), 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 961 of file wm_xr_session.c.
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().
Definition at line 577 of file wm_xr_session.c.
References wmXrRuntimeData::context, and wmXrData::runtime.
Referenced by wm_xr_session_create_cb().
void wm_xr_session_actions_update | ( | wmWindowManager * | wm | ) |
Definition at line 1168 of file wm_xr_session.c.
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, NULL, 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 391 of file wm_xr_session.c.
References wmXrRuntimeData::area, NULL, and wmXrData::runtime.
|
static |
Definition at line 159 of file wm_xr_session.c.
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(), Object::obmat, quat_to_eul(), scene, XR_BASE_POSE_CUSTOM, and XR_BASE_POSE_OBJECT.
Referenced by wm_xr_session_draw_data_populate().
Definition at line 149 of file wm_xr_session.c.
References wmXrSessionState::force_reset_to_base_pose, wmXrData::runtime, and wmXrRuntimeData::session_state.
|
static |
Definition at line 107 of file wm_xr_session.c.
References wm_xr_session_create_cb(), and wm_xr_session_exit_cb().
Referenced by wm_xr_session_toggle().
|
static |
Definition at line 662 of file wm_xr_session.c.
References BLI_findstring(), controller, NULL, 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 1270 of file wm_xr_session.c.
References wmXrSurfaceData::controller_art, wmXrSurfaceData::controller_draw_handle, wmSurface::customdata, ED_region_draw_cb_exit(), g_xr_surface, NULL, 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 72 of file wm_xr_session.c.
References BLI_freelinkN(), BLI_pophead(), Freestyle::c, 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 1235 of file wm_xr_session.c.
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, 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 609 of file wm_xr_session.c.
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 586 of file wm_xr_session.c.
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().
Definition at line 51 of file wm_xr_session.c.
References XrSessionSettings::base_scale, 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 85 of file wm_xr_session.c.
References state, and wm_xr_session_controller_data_free().
Referenced by wm_xr_runtime_data_free().
Definition at line 1328 of file wm_xr_session.c.
References BKE_scene_graph_evaluated_ensure(), C, 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 256 of file wm_xr_session.c.
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 197 of file wm_xr_session.c.
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 287 of file wm_xr_session.c.
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 1017 of file wm_xr_session.c.
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, 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 1087 of file wm_xr_session.c.
References wmXrActionSet::active_haptic_actions, wmXrActionSet::active_modal_actions, wmXrAction::active_modal_path, count, wmXrAction::count_subaction_paths, wmXrAction::haptic_name, KM_NOTHING, MEM_calloc_arrayN, MEM_freeN, wmOperatorType::modal, wmXrActionSet::name, NULL, wmXrAction::ot, PIL_check_seconds_timer(), 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().
Definition at line 144 of file wm_xr_session.c.
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().
Definition at line 90 of file wm_xr_session.c.
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().
Definition at line 1466 of file wm_xr_session.c.
References NC_WM, ND_XR_DATA_CHANGED, NULL, surface, 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 | UNUSEDcontext | ) |
Definition at line 1479 of file wm_xr_session.c.
References g_xr_surface, NC_WM, ND_XR_DATA_CHANGED, NULL, WM_main_add_notifier(), wm_surface_remove(), and wm_window_reset_drawable().
|
static |
Definition at line 776 of file wm_xr_session.c.
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 764 of file wm_xr_session.c.
References LISTBASE_FOREACH, and NULL.
Referenced by wm_xr_session_action_states_interpret(), and wm_xr_session_haptic_action_add().
|
static |
Definition at line 796 of file wm_xr_session.c.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 807 of file wm_xr_session.c.
References BLI_freelinkN(), and LISTBASE_FOREACH_MUTABLE.
Referenced by wm_xr_session_events_dispatch().
Definition at line 154 of file wm_xr_session.c.
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 753 of file wm_xr_session.c.
References BLI_freelinkN(), and LISTBASE_FOREACH.
Referenced by wm_xr_session_action_states_interpret().
|
static |
Definition at line 715 of file wm_xr_session.c.
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 742 of file wm_xr_session.c.
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 214 of file wm_xr_session.c.
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 an own depsgraph, which is an expense we should avoid.
Definition at line 233 of file wm_xr_session.c.
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, |
unsigned int | subaction_idx, | ||
float | r_location[3] | ||
) |
Definition at line 468 of file wm_xr_session.c.
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, |
unsigned int | subaction_idx, | ||
float | r_rotation[4] | ||
) |
Definition at line 485 of file wm_xr_session.c.
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, |
unsigned int | subaction_idx, | ||
float | r_location[3] | ||
) |
Definition at line 434 of file wm_xr_session.c.
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, |
unsigned int | subaction_idx, | ||
float | r_rotation[4] | ||
) |
Definition at line 451 of file wm_xr_session.c.
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 386 of file wm_xr_session.c.
References NULL, wmXrData::runtime, and wmXrRuntimeData::session_state.
Definition at line 502 of file wm_xr_session.c.
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 513 of file wm_xr_session.c.
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 521 of file wm_xr_session.c.
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 532 of file wm_xr_session.c.
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 541 of file wm_xr_session.c.
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 552 of file wm_xr_session.c.
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 562 of file wm_xr_session.c.
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 267 of file wm_xr_session.c.
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 335 of file wm_xr_session.c.
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(), XR_SESSION_USE_ABSOLUTE_TRACKING, XR_SESSION_USE_POSITION_TRACKING, and zero_v3().
Referenced by wm_xr_draw_view().
Definition at line 396 of file wm_xr_session.c.
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 418 of file wm_xr_session.c.
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 407 of file wm_xr_session.c.
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().
Definition at line 1438 of file wm_xr_session.c.
References BLI_assert, data, g_xr_surface, MEM_callocN, RGN_TYPE_XR, surface, 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().
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 1303 of file wm_xr_session.c.
References C, 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().
Definition at line 1412 of file wm_xr_session.c.
References BLI_freelinkN(), BLI_freelistN(), BLI_pophead(), data, g_xr_surface, GPU_offscreen_free(), GPU_viewport_free(), MEM_freeN, NULL, wmXrViewportPair::offscreen, surface, and wmXrViewportPair::viewport.
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 1342 of file wm_xr_session.c.
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_R8, GPU_RGB10_A2, GPU_RGBA16, GPU_RGBA16F, GPU_RGBA8, GPU_viewport_create(), GPU_viewport_free(), LOG, MEM_callocN, NULL, 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 120 of file wm_xr_session.c.
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 | ( | void | ) |
Definition at line 1492 of file wm_xr_session.c.
References wmSurface::customdata, data, g_xr_surface, and NULL.
Referenced by DRW_draw_callbacks_post_scene().
Definition at line 46 of file wm_xr_session.c.
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 47 of file wm_xr_session.c.
Referenced by wm_xr_session_surface_offscreen_ensure().