Blender
V3.3
|
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 |
Typedefs | |
typedef struct wmXrSessionState | wmXrSessionState |
typedef struct wmXrRuntimeData | wmXrRuntimeData |
typedef struct wmXrViewportPair | wmXrViewportPair |
typedef struct wmXrDrawData | wmXrDrawData |
typedef struct wmXrController | wmXrController |
typedef struct wmXrAction | wmXrAction |
typedef struct wmXrHapticAction | wmXrHapticAction |
typedef struct wmXrActionSet | wmXrActionSet |
typedef struct wmXrAction wmXrAction |
typedef struct wmXrActionSet wmXrActionSet |
typedef struct wmXrController wmXrController |
typedef struct wmXrDrawData wmXrDrawData |
typedef struct wmXrHapticAction wmXrHapticAction |
typedef struct wmXrRuntimeData wmXrRuntimeData |
typedef struct wmXrSessionState wmXrSessionState |
typedef struct wmXrViewportPair wmXrViewportPair |
void wm_xr_draw_controllers | ( | const struct bContext * | C, |
struct ARegion * | region, | ||
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 128 of file wm_xr_draw.c.
References 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(), NULL, 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, 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().
Definition at line 56 of file wm_xr_draw.c.
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 38 of file wm_xr_draw.c.
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().
Definition at line 48 of file wm_xr_draw.c.
References invert_qt_qt_normalized(), quat_to_mat4(), and translate_m4().
Referenced by wm_xr_draw_matrices_create(), and wm_xr_navigation_fly_modal().
Definition at line 32 of file wm_xr_draw.c.
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 | ) |
void wm_xr_runtime_data_free | ( | wmXrRuntimeData ** | runtime | ) |
Definition at line 150 of file wm_xr.c.
References blender::compositor::context, ED_area_offscreen_free(), G_MAIN, GHOST_XrContextDestroy(), MEM_SAFE_FREE, NULL, 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().
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().
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().
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().
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().
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().
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 | context | ) |
Referenced by wm_xr_init().
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().
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().
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().