|
Blender V5.0
|
#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 |
| struct | wmXrVignetteData |
Functions | |
| wmXrRuntimeData * | wm_xr_runtime_data_create () |
| void | wm_xr_runtime_data_free (wmXrRuntimeData **runtime) |
| void | wm_xr_session_data_free (wmXrSessionState *state) |
| wmWindow * | wm_xr_session_root_window_or_fallback_get (const wmWindowManager *wm, const wmXrRuntimeData *runtime_data) |
| void | wm_xr_session_draw_data_update (wmXrSessionState *state, const XrSessionSettings *settings, const GHOST_XrDrawViewInfo *draw_view, wmXrDrawData *draw_data) |
| void | wm_xr_session_state_update (const XrSessionSettings *settings, const wmXrDrawData *draw_data, const GHOST_XrDrawViewInfo *draw_view, wmXrSessionState *state) |
| bool | wm_xr_session_surface_offscreen_ensure (wmXrSurfaceData *surface_data, const GHOST_XrDrawViewInfo *draw_view) |
| void * | wm_xr_session_gpu_binding_context_create () |
| void | wm_xr_session_gpu_binding_context_destroy (GHOST_ContextHandle context) |
| void | wm_xr_session_actions_init (wmXrData *xr) |
| void | wm_xr_session_actions_update (wmWindowManager *wm) |
| void | wm_xr_session_controller_data_populate (const wmXrAction *grip_action, const wmXrAction *aim_action, wmXrData *xr) |
| void | wm_xr_session_controller_data_clear (wmXrSessionState *state) |
| void | wm_xr_pose_to_mat (const GHOST_XrPose *pose, float r_mat[4][4]) |
| void | wm_xr_pose_scale_to_mat (const GHOST_XrPose *pose, float scale, float r_mat[4][4]) |
| void | wm_xr_pose_to_imat (const GHOST_XrPose *pose, float r_imat[4][4]) |
| void | wm_xr_pose_scale_to_imat (const GHOST_XrPose *pose, float scale, float r_imat[4][4]) |
| void | wm_xr_draw_view (const GHOST_XrDrawViewInfo *draw_view, void *customdata) |
| Draw a viewport for a single eye. | |
| void | wm_xr_draw_controllers (const bContext *C, ARegion *region, void *customdata) |
| bool | wm_xr_passthrough_enabled (void *customdata) |
| Check if XR passthrough is enabled. | |
| void | wm_xr_disable_passthrough (void *customdata) |
| Disable XR passthrough if not supported. | |
| 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 216 of file wm_xr_draw.cc.
References XrSessionSettings::draw_flags, RPT_INFO, wmXrData::session_settings, V3D_OFSDRAW_XR_SHOW_PASSTHROUGH, WM_global_report(), and wmXrDrawData::xr_data.
Referenced by wm_xr_init().
Definition at line 429 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 140 of file wm_xr_draw.cc.
References wmXrVignetteData::aperture, BLI_assert, BLI_findlink(), XrSessionSettings::clip_end, XrSessionSettings::clip_start, wmXrDrawData::depsgraph, XrSessionSettings::draw_flags, ED_view3d_draw_offscreen_simple(), GPU_clear_depth(), GPU_framebuffer_restore(), GPU_offscreen_bind(), XrSessionSettings::object_type_exclude_select, XrSessionSettings::object_type_exclude_viewport, wmXrViewportPair::offscreen, wmXrData::runtime, wmXrDrawData::scene, wmXrData::session_settings, wmXrRuntimeData::session_state, XrSessionSettings::shading, wmXrDrawData::surface_data, View3DShading::type, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, wmXrViewportPair::viewport, wmXrSurfaceData::viewports, wmXrSessionState::vignette_data, 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 207 of file wm_xr_draw.cc.
References XrSessionSettings::draw_flags, wmXrData::session_settings, V3D_OFSDRAW_XR_SHOW_PASSTHROUGH, and wmXrDrawData::xr_data.
Referenced by wm_xr_init().
Definition at line 63 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 45 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 55 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 39 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 170 of file wm_xr.cc.
References ED_area_offscreen_free(), G_MAIN, GHOST_XrContextDestroy(), wmWindow::handlers, MEM_SAFE_FREE, WM_event_remove_handlers_by_area(), 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 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().