|
Blender V4.3
|
#include "CLG_log.h"#include "GHOST_Types.h"#include "DNA_listBase.h"#include "DNA_xr_types.h"#include "wm_xr.hh"Go to the source code of this file.
Classes | |
| struct | wmXrSessionState |
| struct | wmXrRuntimeData |
| struct | wmXrViewportPair |
| struct | wmXrSurfaceData |
| struct | wmXrDrawData |
| struct | wmXrController |
| struct | wmXrAction |
| struct | wmXrHapticAction |
| struct | wmXrActionSet |
| void wm_xr_disable_passthrough | ( | void * | customdata | ) |
Disable XR passthrough if not supported.
In case passthrough is not supported by the XR runtime, force un-check the toggle in the GUI. It's assigned to Ghost-XR as a callback (see GHOST_XrDisablePassthroughFunc()).
Definition at line 209 of file wm_xr_draw.cc.
References XrSessionSettings::draw_flags, RPT_INFO, wmXrData::session_settings, WM_report(), and wmXrDrawData::xr_data.
Referenced by wm_xr_init().
Definition at line 421 of file wm_xr_draw.cc.
References wmXrRuntimeData::context, wmXrData::runtime, wmXrData::session_settings, wmXrRuntimeData::session_state, state, wm_xr_controller_aim_draw(), and wm_xr_controller_model_draw().
Referenced by wm_xr_session_controller_data_populate().
| void wm_xr_draw_view | ( | const GHOST_XrDrawViewInfo * | draw_view, |
| void * | customdata ) |
Draw a viewport for a single eye.
This is the main viewport drawing function for VR sessions. It's assigned to Ghost-XR as a callback (see GHOST_XrDrawViewFunc()) and executed for each view (read: eye).
Definition at line 134 of file wm_xr_draw.cc.
References BLI_assert, BLI_findlink(), wmXrDrawData::depsgraph, XrSessionSettings::draw_flags, draw_view, ED_view3d_draw_offscreen_simple(), GPU_clear_depth(), GPU_framebuffer_restore(), GPU_offscreen_bind(), wmXrViewportPair::offscreen, wmXrData::runtime, wmXrDrawData::scene, wmXrData::session_settings, wmXrRuntimeData::session_state, wmXrDrawData::surface_data, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, wmXrViewportPair::viewport, wmXrSurfaceData::viewports, wm_xr_draw_matrices_create(), wm_xr_draw_viewport_buffers_to_active_framebuffer(), wm_xr_session_draw_data_update(), WM_xr_session_is_ready(), wm_xr_session_state_update(), wm_xr_session_surface_offscreen_ensure(), and wmXrDrawData::xr_data.
Referenced by wm_xr_init().
| bool wm_xr_passthrough_enabled | ( | void * | customdata | ) |
Check if XR passthrough is enabled.
Needed to add or not the passthrough composition layer. It's assigned to Ghost-XR as a callback (see GHOST_XrPassthroughEnabledFunc()).
Definition at line 200 of file wm_xr_draw.cc.
References wmXrData::session_settings, V3D_OFSDRAW_XR_SHOW_PASSTHROUGH, and wmXrDrawData::xr_data.
Referenced by wm_xr_init().
Definition at line 57 of file wm_xr_draw.cc.
References BLI_assert, invert_qt_qt_normalized(), mul_v3_fl(), quat_to_mat4(), and translate_m4().
Referenced by wm_xr_draw_matrices_create(), wm_xr_navigation_grab_apply(), wm_xr_session_actions_update(), and wm_xr_session_state_update().
Definition at line 39 of file wm_xr_draw.cc.
References BLI_assert, mul_v3_fl(), and wm_xr_pose_to_mat().
Referenced by wm_xr_navigation_grab_apply(), wm_xr_session_actions_update(), wm_xr_session_controller_data_update(), and wm_xr_session_state_update().
| void wm_xr_pose_to_imat | ( | const GHOST_XrPose * | pose, |
| float | r_imat[4][4] ) |
Definition at line 49 of file wm_xr_draw.cc.
References invert_qt_qt_normalized(), quat_to_mat4(), and translate_m4().
Referenced by wm_xr_draw_matrices_create(), and wm_xr_navigation_fly_modal().
| void wm_xr_pose_to_mat | ( | const GHOST_XrPose * | pose, |
| float | r_mat[4][4] ) |
Definition at line 33 of file wm_xr_draw.cc.
References copy_v3_v3(), and quat_to_mat4().
Referenced by wm_xr_navigation_fly_modal(), wm_xr_pose_scale_to_mat(), wm_xr_session_controller_pose_calc(), and wm_xr_session_state_update().
| wmXrRuntimeData * wm_xr_runtime_data_create | ( | ) |
| void wm_xr_runtime_data_free | ( | wmXrRuntimeData ** | runtime | ) |
Definition at line 156 of file wm_xr.cc.
References wmXrRuntimeData::context, ED_area_offscreen_free(), G_MAIN, GHOST_XrContextDestroy(), MEM_SAFE_FREE, WM_xr_actionmaps_clear(), wm_xr_session_data_free(), and wm_xr_session_root_window_or_fallback_get().
Referenced by wm_xr_error_handler(), wm_xr_exit(), and wm_xr_session_exit_cb().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().