Blender V5.3
wm_xr_intern.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "CLG_log.h"
12
13#include "GHOST_IContext.hh"
14#include "GHOST_IXrContext.hh"
15#include "GHOST_Types.hh"
16
17#include "DNA_listBase.h"
18#include "DNA_xr_types.h"
19
20#include "wm_xr.hh"
21
22namespace blender {
23
24struct bContext;
25struct ARegion;
26struct Camera;
27struct GPUOffScreen;
28struct Object;
29struct wmWindow;
30struct wmWindowManager;
31struct wmXrActionSet;
32struct wmXrController;
33struct wmXrData;
34
35namespace gpu {
36class Texture;
37}
38
82
149
168
174
177 ListBaseT<wmXrViewportPair> viewports;
178
183};
184
188
194 GHOST_XrPose base_pose;
201 float eye_position_ofs[3]; /* Local/view space. */
202};
203
207 char subaction_path[64]; /* #XR_MAX_USER_PATH_LENGTH. */
208
211 GHOST_XrPose grip_pose;
212 float grip_mat[4][4];
213 float grip_mat_base[4][4];
216 GHOST_XrPose aim_pose;
217 float aim_mat[4][4];
218 float aim_mat_base[4][4];
219
221 gpu::Batch *model;
222};
223
256
263
276
277/* `wm_xr.cc` */
278
281
282/* `wm_xr_session.cc` */
283
286 const wmXrRuntimeData *runtime_data);
288 const XrSessionSettings *settings,
289 const GHOST_XrDrawViewInfo *draw_view,
290 wmXrDrawData *draw_data);
297 const wmXrDrawData *draw_data,
298 const GHOST_XrDrawViewInfo *draw_view,
301 const GHOST_XrDrawViewInfo *draw_view);
304
308 const wmXrAction *aim_action,
309 wmXrData *xr);
311
312/* `wm_xr_draw.cc` */
313
314void wm_xr_pose_to_mat(const GHOST_XrPose *pose, float r_mat[4][4]);
315void wm_xr_pose_scale_to_mat(const GHOST_XrPose *pose, float scale, float r_mat[4][4]);
316void wm_xr_pose_to_imat(const GHOST_XrPose *pose, float r_imat[4][4]);
317void wm_xr_pose_scale_to_imat(const GHOST_XrPose *pose, float scale, float r_imat[4][4]);
324void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata);
325void wm_xr_draw_controllers(const bContext *C, ARegion *region, void *customdata);
326
333bool wm_xr_passthrough_enabled(void *customdata);
340void wm_xr_disable_passthrough(void *customdata);
341
342/* `wm_xr_location_scouting.cc` */
343
347 const XrSessionSettings *settings,
349
350} // namespace blender
These structs are the foundation for all linked lists in the library system.
#define C
Definition RandGen.cpp:29
float3x3 scale(float3x3 mat, float2 scale)
const int state
BMesh Iterators.
void wm_xr_pose_to_mat(const GHOST_XrPose *pose, float r_mat[4][4])
Definition wm_xr_draw.cc:44
bool wm_xr_passthrough_enabled(void *customdata)
Check if XR passthrough is enabled.
void wm_xr_session_controller_data_populate(const wmXrAction *grip_action, const wmXrAction *aim_action, wmXrData *xr)
__int64 int64_t
Definition BKE_text.h:90
wmWindow * wm_xr_session_root_window_or_fallback_get(const wmWindowManager *wm, const wmXrRuntimeData *runtime_data)
void(*)(const wmXrData *xr_data) wmXrSessionExitFn
Definition wm_xr.hh:17
void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata)
Draw a viewport for a single eye.
bool wm_xr_viewfinder_operator_event_match_hand(bContext *C, const wmEvent *event)
void wm_xr_session_actions_update(wmWindowManager *wm)
eXrViewfinderPlaybackAction
GHOST_IContext * wm_xr_session_gpu_binding_context_create()
void wm_xr_draw_controllers(const bContext *C, ARegion *, void *customdata)
void wm_xr_session_controller_data_clear(wmXrSessionState *state)
void wm_xr_viewfinder_render_view(wmXrData *xr_data)
void wm_xr_session_state_update(const XrSessionSettings *settings, const wmXrDrawData *draw_data, const GHOST_XrDrawViewInfo *draw_view, wmXrSessionState *state)
void wm_xr_session_gpu_binding_context_destroy(GHOST_IContext *context)
eXrViewfinderLiveAction
bool wm_xr_session_surface_offscreen_ensure(wmXrSurfaceData *surface_data, const GHOST_XrDrawViewInfo *draw_view)
void wm_xr_pose_scale_to_mat(const GHOST_XrPose *pose, float scale, float r_mat[4][4])
Definition wm_xr_draw.cc:50
void wm_xr_session_actions_init(wmXrData *xr)
void wm_xr_pose_to_imat(const GHOST_XrPose *pose, float r_imat[4][4])
Definition wm_xr_draw.cc:60
void wm_xr_viewfinder_draw(const bContext *C, const XrSessionSettings *settings, wmXrSessionState *state)
void wm_xr_session_draw_data_update(wmXrSessionState *state, const XrSessionSettings *settings, const GHOST_XrDrawViewInfo *draw_view, wmXrDrawData *draw_data)
void wm_xr_runtime_data_free(wmXrRuntimeData **runtime)
Definition wm_xr.cc:192
void wm_xr_session_data_free(wmXrSessionState *state)
void wm_xr_disable_passthrough(void *customdata)
Disable XR passthrough if not supported.
void wm_xr_pose_scale_to_imat(const GHOST_XrPose *pose, float scale, float r_imat[4][4])
Definition wm_xr_draw.cc:68
wmXrRuntimeData * wm_xr_runtime_data_create()
Definition wm_xr.cc:186
eXrViewfinderConfirmAction
wmXrAction * controller_aim_action
ListBaseT< LinkData > active_modal_actions
wmXrAction * controller_grip_action
ListBaseT< wmXrHapticAction > active_haptic_actions
IDProperty * op_properties
eXrAxisFlag * axis_flags
eXrHapticFlag haptic_flag
const char * active_modal_path
eXrActionFlag action_flag
struct wmOperatorType * ot
unsigned int count_subaction_paths
struct wmXrController * next
struct wmXrController * prev
wmXrSurfaceData * surface_data
struct wmXrHapticAction * next
struct wmXrHapticAction * prev
wmXrSessionExitFn exit_fn
ListBaseT< XrActionMap > actionmaps
wmXrSessionState session_state
GHOST_IXrContext * ghost_context
ListBaseT< wmXrController > controllers
GHOST_XrPose nav_pose_last_actions_sync
struct wmXrActionSet * active_action_set
wmXrViewfinderState viewfinder
struct ARegionType * controller_art
ListBaseT< wmXrViewportPair > viewports
gpu::Texture * backside_logo_texture
eXrViewfinderLiveAction active_action_live
static constexpr int view_resolution
static constexpr float accent_color[4]
eXrViewfinderMode active_mode
eXrViewfinderPlaybackAction active_action_playback
eXrViewfinderConfirmAction active_action_confirm
static constexpr float xr_ui_unit_fac
struct GPUOffScreen * offscreen
struct wmXrViewportPair * prev
struct GPUViewport * viewport
struct wmXrViewportPair * next