64 wmXrActionData *actiondata =
event->customdata;
65 return (actiondata->ot == op->
type &&
88 ED_view3d_xr_mirror_update(
area, v3d, session_exists);
95 ED_view3d_xr_shading_update(wm, v3d,
scene);
140 ot->
name =
"Toggle VR Session";
141 ot->
idname =
"WM_OT_xr_session_toggle";
143 "Open a view for use with virtual reality headsets, or close it if already "
187 if (actiondata->bimanual) {
189 copy_v3_v3(
data->mat_other_prev[3], actiondata->controller_loc_other);
190 data->bimanual_prev =
true;
193 data->bimanual_prev =
false;
199 const float scale =
len_v3(
R[0]);
200 float x_axis[3], y_axis[3];
214 const float nav_inv[4][4],
222 float prev_base[4][4], curr_base[4][4];
228 const float z_axis[3] = {0.0f, 0.0f, 1.0f};
236 else if (locz_lock) {
237 curr_base[3][2] = prev_base[3][2];
255 const float nav_mat[4][4],
256 const float nav_inv[4][4],
260 const bool nav_lock = (nav_mat && nav_inv);
261 float prev[4][4], curr[4][4];
263 if (!
data->rot_lock) {
273 if (!
data->loc_lock || nav_lock) {
275 copy_v3_v3(curr[3], actiondata->controller_loc);
280 nav_mat, nav_inv,
data->loc_lock,
data->locz_lock,
data->rotz_lock,
prev, curr);
307 const float nav_mat[4][4],
308 const float nav_inv[4][4],
312 const bool nav_lock = (nav_mat && nav_inv);
313 float prev[4][4], curr[4][4];
317 if (!
data->rot_lock) {
319 float x_axis_prev[3], x_axis_curr[3], y_axis_prev[3], y_axis_curr[3], z_axis_prev[3],
321 float m0[3][3], m1[3][3];
327 sub_v3_v3v3(x_axis_curr, actiondata->controller_loc, actiondata->controller_loc_other);
348 if (!
data->loc_lock || nav_lock) {
352 add_v3_v3v3(curr[3], actiondata->controller_loc, actiondata->controller_loc_other);
356 if (!
data->scale_lock) {
366 sub_v3_v3v3(
v, actiondata->controller_loc, actiondata->controller_loc_other);
375 nav_mat, nav_inv,
data->loc_lock,
data->locz_lock,
data->rotz_lock,
prev, curr);
402 const wmXrActionData *actiondata =
event->customdata;
425 return (actiondata->bimanual &&
data->bimanual_prev);
431 return (!actiondata->bimanual &&
data->bimanual_prev);
437 return data->loc_lock &&
data->rot_lock &&
data->scale_lock;
440 return data->loc_lock &&
data->rot_lock;
444 const wmXrActionData *actiondata,
448 GHOST_XrPose nav_pose;
450 float nav_mat[4][4], nav_inv[4][4], delta[4][4],
out[4][4];
452 const bool need_navinv = (
data->loc_lock ||
data->locz_lock ||
data->rotz_lock);
465 actiondata,
data, need_navinv ? nav_mat :
NULL, need_navinv ? nav_inv :
NULL,
true, delta);
469 actiondata,
data, need_navinv ? nav_mat :
NULL, need_navinv ? nav_inv :
NULL,
true, delta);
477 if (!(nav_scale < xr->session_settings.clip_start ||
480 if (!
data->rot_lock) {
485 if (!
data->scale_lock && bimanual) {
494 if (actiondata->bimanual) {
495 if (!
data->bimanual_prev) {
499 copy_v3_v3(
data->mat_other_prev[3], actiondata->controller_loc_other);
501 data->bimanual_prev =
true;
504 if (
data->bimanual_prev) {
508 data->bimanual_prev =
false;
518 const wmXrActionData *actiondata =
event->customdata;
546 switch (event->
val) {
562 ot->
name =
"XR Navigation Grab";
563 ot->
idname =
"WM_OT_xr_navigation_grab";
564 ot->
description =
"Navigate the VR scene by grabbing with controllers";
574 ot->
srna,
"lock_location",
false,
"Lock Location",
"Prevent changes to viewer location");
576 ot->
srna,
"lock_location_z",
false,
"Lock Elevation",
"Prevent changes to viewer elevation");
578 ot->
srna,
"lock_rotation",
false,
"Lock Rotation",
"Prevent changes to viewer rotation");
582 "Lock Up Orientation",
583 "Prevent changes to viewer up orientation");
614 if (
data->from_viewer) {
689 const wmXrActionData *actiondata)
692 float ray_length, axis[3];
698 if (
data->from_viewer) {
707 mul_qt_v3(actiondata->controller_rot, axis);
717 const float origin[3],
718 const float direction[3],
720 bool selectable_only,
758 #define XR_DEFAULT_FLY_SPEED_MOVE 0.054f
759 #define XR_DEFAULT_FLY_SPEED_TURN 0.03f
799 const float ref_quat[4],
800 const float nav_mat[4][4],
804 float ref_axes[3][3];
852 float z_axis[3], projected[3];
866 const float viewer_mat[4][4],
867 const float nav_mat[4][4],
868 const float nav_inv[4][4],
873 float z_axis[3], m[3][3],
prev[4][4], curr[4][4];
891 const float nav_rotation[4],
895 float base_eul[3], base_quatz[4];
932 const wmXrActionData *actiondata =
event->customdata;
937 bool turn, locz_lock, dir_lock, speed_frame_based;
938 bool speed_interp_cubic =
false;
939 float speed, speed_max, speed_p0[2], speed_p1[2];
940 GHOST_XrPose nav_pose;
941 float nav_mat[4][4], delta[4][4],
out[4][4];
957 speed_interp_cubic =
true;
960 speed_p0[0] = speed_p0[1] = 0.0f;
966 speed_interp_cubic =
true;
969 speed_p1[0] = speed_p1[1] = 1.0f;
973 if (speed_max < speed) {
978 switch (actiondata->type) {
985 len_v2(actiondata->state);
986 float speed_t = (actiondata->float_threshold < 1.0f) ?
987 (
state - actiondata->float_threshold) /
988 (1.0f - actiondata->float_threshold) :
990 if (speed_interp_cubic) {
991 float start[2], end[2], p[2];
995 speed_p0[1] = speed + speed_p0[1] * (speed_max - speed);
996 speed_p1[1] = speed + speed_p1[1] * (speed_max - speed);
1004 speed += speed_t * (speed_max - speed);
1014 if (!speed_frame_based) {
1016 speed *= time_now -
data->time_prev;
1018 data->time_prev = time_now;
1029 GHOST_XrPose viewer_pose;
1030 float viewer_mat[4][4], nav_inv[4][4];
1041 float nav_scale, ref_quat[4];
1071 copy_qt_qt(ref_quat, actiondata->controller_rot);
1104 ot->
name =
"XR Navigation Fly";
1105 ot->
idname =
"WM_OT_xr_navigation_fly";
1106 ot->
description =
"Move/turn relative to the VR viewer or controller";
1116 {
XR_FLY_FORWARD,
"FORWARD", 0,
"Forward",
"Move along navigation forward axis"},
1117 {
XR_FLY_BACK,
"BACK", 0,
"Back",
"Move along navigation back axis"},
1118 {
XR_FLY_LEFT,
"LEFT", 0,
"Left",
"Move along navigation left axis"},
1119 {
XR_FLY_RIGHT,
"RIGHT", 0,
"Right",
"Move along navigation right axis"},
1120 {
XR_FLY_UP,
"UP", 0,
"Up",
"Move along navigation up axis"},
1121 {
XR_FLY_DOWN,
"DOWN", 0,
"Down",
"Move along navigation down axis"},
1126 "Turn counter-clockwise around navigation up axis"},
1127 {
XR_FLY_TURNRIGHT,
"TURNRIGHT", 0,
"Turn Right",
"Turn clockwise around navigation up axis"},
1132 "Move along viewer's forward axis"},
1133 {
XR_FLY_VIEWER_BACK,
"VIEWER_BACK", 0,
"Viewer Back",
"Move along viewer's back axis"},
1134 {
XR_FLY_VIEWER_LEFT,
"VIEWER_LEFT", 0,
"Viewer Left",
"Move along viewer's left axis"},
1135 {
XR_FLY_VIEWER_RIGHT,
"VIEWER_RIGHT", 0,
"Viewer Right",
"Move along viewer's right axis"},
1137 "CONTROLLER_FORWARD",
1139 "Controller Forward",
1140 "Move along controller's forward axis"},
1144 static const float default_speed_p0[2] = {0.0f, 0.0f};
1145 static const float default_speed_p1[2] = {1.0f, 1.0f};
1149 ot->
srna,
"lock_location_z",
false,
"Lock Elevation",
"Prevent changes to viewer elevation");
1154 "Limit movement to viewer's initial direction");
1156 "speed_frame_based",
1158 "Frame Based Speed",
1159 "Apply fixed movement deltas every update");
1166 "Minimum move (turn) speed in meters (radians) per second or frame",
1175 "Maximum move (turn) speed in meters (radians) per second or frame",
1179 "speed_interpolation0",
1184 "Speed Interpolation 0",
1185 "First cubic spline control point between min/max speeds",
1189 "speed_interpolation1",
1194 "Speed Interpolation 1",
1195 "Second cubic spline control point between min/max speeds",
1210 const float origin[3],
1211 const float direction[3],
1213 bool selectable_only,
1214 const bool teleport_axes[3],
1240 float nav_location[3], nav_rotation[4], viewer_location[3];
1241 float nav_axes[3][3], projected[3], v0[3],
v1[3];
1242 float out[3] = {0.0f, 0.0f, 0.0f};
1252 for (
int a = 0;
a < 3; ++
a) {
1254 if (teleport_axes[
a]) {
1300 const wmXrActionData *actiondata =
event->customdata;
1306 switch (event->
val) {
1311 bool selectable_only, teleport_axes[3];
1312 float teleport_t, teleport_ofs, ray_dist;
1345 ot->
name =
"XR Navigation Teleport";
1346 ot->
idname =
"WM_OT_xr_navigation_teleport";
1347 ot->
description =
"Set VR viewer location to controller raycast hit location";
1356 static bool default_teleport_axes[3] = {
true,
true,
true};
1361 default_teleport_axes,
1363 "Enabled teleport axes in navigation space");
1370 "Interpolation factor between viewer and hit locations",
1379 "Offset along hit normal to subtract from final location",
1386 "Only allow selectable objects to influence raycast result");
1393 "Maximum raycast distance",
1397 ot->
srna,
"from_viewer",
false,
"From Viewer",
"Use viewer pose as raycast origin");
1405 "Raycast axis in controller/viewer space",
1432 bool reset_loc, reset_rot, reset_scale;
1441 float nav_rotation[4], nav_scale;
1466 float nav_location[3], nav_rotation[4], nav_scale;
1467 float nav_axes[3][3],
v[3];
1495 ot->
name =
"XR Navigation Reset";
1496 ot->
idname =
"WM_OT_xr_navigation_reset";
1497 ot->
description =
"Reset VR navigation deltas relative to session base pose";
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
bool IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2) ATTR_WARN_UNUSED_RESULT
struct SpaceType * BKE_spacetype_from_id(int spaceid)
struct ARegionType * BKE_regiontype_from_id(const struct SpaceType *st, int regionid)
#define BLI_assert_unreachable()
#define BVH_RAYCAST_DIST_MAX
#define LISTBASE_FOREACH(type, var, list)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4(float R[4][4])
void unit_m4(float m[4][4])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], float angle)
void axis_angle_to_quat_single(float q[4], char axis, float angle)
float normalize_qt(float q[4])
void mul_qt_v3(const float q[4], float r[3])
void quat_to_eul(float eul[3], const float quat[4])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void mat4_to_quat(float q[4], const float mat[4][4])
void copy_qt_qt(float q[4], const float a[4])
void quat_to_mat3(float mat[3][3], const float q[4])
void quat_to_mat4(float mat[4][4], const float q[4])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
void interp_v2_v2v2v2v2_cubic(float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2], float u)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
struct Depsgraph Depsgraph
@ SCE_SNAP_TARGET_ONLY_SELECTABLE
@ V3D_RUNTIME_XR_SESSION_ROOT
#define V3D_XR_SESSION_MIRROR
bool ED_operator_view3d_active(struct bContext *C)
#define REGION_DRAW_POST_VIEW
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
SnapObjectContext * ED_transform_snap_object_context_create(struct Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
bool ED_transform_snap_object_project_ray_ex(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const View3D *v3d, const struct SnapObjectParams *params, const float ray_start[3], const float ray_normal[3], float *ray_depth, float r_loc[3], float r_no[3], int *r_index, struct Object **r_ob, float r_obmat[4][4])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
void GPU_point_size(float size)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
Read Guarded memory(de)allocation.
Platform independent time functions.
#define ND_XR_DATA_CHANGED
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Depsgraph * depsgraph
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
SymEdge< T > * prev(const SymEdge< T > *se)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, bool *default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
float mat_other_prev[4][4]
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
wmXrSessionState session_state
GHOST_XrPose prev_base_pose
double PIL_check_seconds_timer(void)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
Scene * WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
bool wm_xr_init(wmWindowManager *wm)
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_scale_to_imat(const GHOST_XrPose *pose, float scale, float r_imat[4][4])
void wm_xr_pose_to_imat(const GHOST_XrPose *pose, float r_imat[4][4])
static void orient_mat_z_normalized(float R[4][4], const float z_axis[3])
static void wm_xr_grab_init(wmOperator *op)
void wm_xr_operatortypes_register(void)
static void wm_xr_navigation_teleport(bContext *C, wmXrData *xr, const float origin[3], const float direction[3], float *ray_dist, bool selectable_only, const bool teleport_axes[3], float teleport_t, float teleport_ofs)
static void wm_xr_fly_init(wmOperator *op, const wmXrData *xr)
static void wm_xr_navigation_grab_bimanual_state_update(const wmXrActionData *actiondata, XrGrabData *data)
static void wm_xr_basenav_rotation_calc(const wmXrData *xr, const float nav_rotation[4], float r_rotation[4])
static void wm_xr_raycast(Scene *scene, Depsgraph *depsgraph, const float origin[3], const float direction[3], float *ray_dist, bool selectable_only, float r_location[3], float r_normal[3], int *r_index, Object **r_ob, float r_obmat[4][4])
static int wm_xr_navigation_teleport_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
static int wm_xr_navigation_grab_modal(bContext *C, wmOperator *op, const wmEvent *event)
static int wm_xr_navigation_fly_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void wm_xr_raycast_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), void *customdata)
struct XrGrabData XrGrabData
static void wm_xr_grab_uninit(wmOperator *op)
static void WM_OT_xr_navigation_fly(wmOperatorType *ot)
static void wm_xr_navigation_grab_apply(wmXrData *xr, const wmXrActionData *actiondata, const XrGrabData *data, bool bimanual)
static void wm_xr_navlocks_apply(const float nav_mat[4][4], const float nav_inv[4][4], bool loc_lock, bool locz_lock, bool rotz_lock, float r_prev[4][4], float r_curr[4][4])
static bool wm_xr_navigation_grab_is_bimanual_ending(const wmXrActionData *actiondata, const XrGrabData *data)
static int wm_xr_navigation_reset_exec(bContext *C, wmOperator *op)
static int wm_xr_navigation_fly_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
static void wm_xr_grab_compute_bimanual(const wmXrActionData *actiondata, const XrGrabData *data, const float nav_mat[4][4], const float nav_inv[4][4], bool reverse, float r_delta[4][4])
static int wm_xr_session_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static void wm_xr_fly_uninit(wmOperator *op)
static bool wm_xr_operator_sessionactive(bContext *C)
#define XR_DEFAULT_FLY_SPEED_MOVE
static void wm_xr_raycast_uninit(wmOperator *op)
static void wm_xr_raycast_update(wmOperator *op, const wmXrData *xr, const wmXrActionData *actiondata)
static bool wm_xr_navigation_grab_is_locked(const XrGrabData *data, const bool bimanual)
static void wm_xr_session_update_screen_on_exit_cb(const wmXrData *xr_data)
static int wm_xr_navigation_grab_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
static int wm_xr_navigation_teleport_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void wm_xr_session_update_screen(Main *bmain, const wmXrData *xr_data)
static bool wm_xr_operator_test_event(const wmOperator *op, const wmEvent *event)
static bool wm_xr_navigation_grab_can_do_bimanual(const wmXrActionData *actiondata, const XrGrabData *data)
static void WM_OT_xr_navigation_teleport(wmOperatorType *ot)
struct XrFlyData XrFlyData
static void wm_xr_grab_update(wmOperator *op, const wmXrActionData *actiondata)
struct XrRaycastData XrRaycastData
static const float g_xr_default_raycast_color[4]
static int wm_xr_navigation_grab_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void WM_OT_xr_navigation_reset(wmOperatorType *ot)
static const float g_xr_default_raycast_axis[3]
static void WM_OT_xr_navigation_grab(wmOperatorType *ot)
@ XR_FLY_CONTROLLER_FORWARD
static void wm_xr_raycast_init(wmOperator *op)
static void wm_xr_grab_compute(const wmXrActionData *actiondata, const XrGrabData *data, const float nav_mat[4][4], const float nav_inv[4][4], bool reverse, float r_delta[4][4])
static void wm_xr_fly_compute_move(eXrFlyMode mode, float speed, const float ref_quat[4], const float nav_mat[4][4], bool locz_lock, float r_delta[4][4])
static void WM_OT_xr_session_toggle(wmOperatorType *ot)
static int wm_xr_navigation_teleport_modal(bContext *C, wmOperator *op, const wmEvent *event)
static int wm_xr_navigation_fly_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void wm_xr_fly_compute_turn(eXrFlyMode mode, float speed, const float viewer_mat[4][4], const float nav_mat[4][4], const float nav_inv[4][4], float r_delta[4][4])
void WM_xr_session_state_nav_scale_set(wmXrData *xr, float scale)
bool WM_xr_session_state_nav_scale_get(const wmXrData *xr, float *r_scale)
void wm_xr_session_toggle(wmWindowManager *wm, wmWindow *session_root_win, wmXrSessionExitFn session_exit_fn)
bool WM_xr_session_state_nav_location_get(const wmXrData *xr, float r_location[3])
void WM_xr_session_state_nav_location_set(wmXrData *xr, const float location[3])
bool WM_xr_session_is_ready(const wmXrData *xr)
bool WM_xr_session_state_viewer_pose_location_get(const wmXrData *xr, float r_location[3])
bool WM_xr_session_exists(const wmXrData *xr)
void WM_xr_session_state_nav_rotation_set(wmXrData *xr, const float rotation[4])
bool WM_xr_session_state_viewer_pose_rotation_get(const wmXrData *xr, float r_rotation[4])
bool WM_xr_session_state_nav_rotation_get(const wmXrData *xr, float r_rotation[4])