Monado OpenXR Runtime
xrt_defines.h
Go to the documentation of this file.
1 // Copyright 2019-2024, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief Common defines and enums for XRT.
6  * @author Jakob Bornecrantz <jakob@collabora.com>
7  * @author Moses Turner <mosesturner@protonmail.com>
8  * @author Nis Madsen <nima_zero_one@protonmail.com>
9  * @author Korcan Hussein <korcan.hussein@collabora.com>
10  * @ingroup xrt_iface
11  */
12 
13 #pragma once
14 
15 #include "xrt/xrt_compiler.h"
16 
17 #include "xrt/xrt_results.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*!
24  * Internal define for VK_UUID_SIZE and XR_UUID_SIZE_EXT.
25  *
26  * @ingroup xrt_iface
27  */
28 #define XRT_UUID_SIZE 16
29 
30 /*!
31  * To transport UUIDs between different APIs.
32  *
33  * @ingroup xrt_iface
34  */
35 struct xrt_uuid
36 {
37  uint8_t data[XRT_UUID_SIZE];
38 };
39 
40 /*!
41  * Typedef for @ref xrt_uuid.
42  *
43  * @ingroup xrt_iface
44  */
45 typedef struct xrt_uuid xrt_uuid_t;
46 
47 /*!
48  * Internal define for VK_LUID_SIZE.
49  *
50  * @ingroup xrt_iface
51  */
52 #define XRT_LUID_SIZE 8
53 
54 /*!
55  * To transport LUIDs between different APIs.
56  *
57  * @ingroup xrt_iface
58  */
59 struct xrt_luid
60 {
61  uint8_t data[XRT_LUID_SIZE];
62 };
63 
64 /*!
65  * Typedef for @ref xrt_luid.
66  *
67  * @ingroup xrt_iface
68  */
69 typedef struct xrt_luid xrt_luid_t;
70 
71 /*!
72  * A limited unique id, it is only unique for the process it is in, so must not be
73  * used or synchronized across process boundaries. A value of zero is invalid
74  * and means it has not be properly initialised.
75  *
76  * @ingroup xrt_iface
77  */
79 {
80  uint64_t data;
81 };
82 
83 /*!
84  * Typedef for @ref xrt_limited_unique_id.
85  *
86  * @ingroup xrt_iface
87  */
89 
90 /*!
91  * A base class for reference counted objects.
92  *
93  * @ingroup xrt_iface
94  */
96 {
97  xrt_atomic_s32_t count;
98 };
99 
100 /*!
101  * Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
102  *
103  * This is not a bitmask because we want to be able to express a preference order
104  * that may vary by device, etc.
105  *
106  * @ingroup xrt_iface
107  */
109 {
110  XRT_BLEND_MODE_OPAQUE = 1,
111  XRT_BLEND_MODE_ADDITIVE = 2,
112  XRT_BLEND_MODE_ALPHA_BLEND = 3,
113  XRT_BLEND_MODE_MAX_ENUM,
114 };
115 
116 #define XRT_MAX_DEVICE_BLEND_MODES 3
117 
118 /*!
119  * Special flags for creating passthrough.
120  */
122 {
123  //! Start the passthrough on creation
125  //! Our compositor just ignores this bit.
127 };
128 
129 /*!
130  * Specify additional state change behavior.
131  */
133 {
134  //! Passthrough system requires reinitialization.
136  //! Non-recoverable error has occurred.
138  //! A recoverable error has occurred.
140  //! The runtime has recovered from a previous error and is functioning normally.
142 };
143 
144 /*!
145  * Specify the kind of passthrough behavior the layer provides.
146  */
148 {
149  //! Fullscreen layer
151  //! Projected layer.
153  //! Provided by XR_FB_passthrough_keyboard_hands
155  //! Provided by XR_FB_passthrough_keyboard_hands
157 };
158 
159 /*!
160  * Which distortion model does the device expose,
161  * used both as a bitfield and value.
162  */
164 {
165  // clang-format off
166  XRT_DISTORTION_MODEL_NONE = 1u << 0u,
167  XRT_DISTORTION_MODEL_COMPUTE = 1u << 1u,
168  XRT_DISTORTION_MODEL_MESHUV = 1u << 2u,
169  // clang-format on
170 };
171 
172 /*!
173  * Common formats, use `u_format_*` functions to reason about them.
174  */
176 {
177  XRT_FORMAT_R8G8B8X8,
178  XRT_FORMAT_R8G8B8A8,
179  XRT_FORMAT_R8G8B8,
180  XRT_FORMAT_R8G8,
181  XRT_FORMAT_R8,
182 
183  XRT_FORMAT_BAYER_GR8,
184 
185  XRT_FORMAT_L8, // Luminence, R = L, G = L, B = L.
186 
187  XRT_FORMAT_BITMAP_8X1, // One bit format tiled in 8x1 blocks.
188  XRT_FORMAT_BITMAP_8X8, // One bit format tiled in 8X8 blocks.
189 
190  XRT_FORMAT_YUV888,
191  XRT_FORMAT_YUYV422,
192  XRT_FORMAT_UYVY422,
193 
194  XRT_FORMAT_MJPEG,
195 };
196 
197 /*!
198  * What type of stereo format a frame has.
199  *
200  * @ingroup xrt_iface
201  */
203 {
204  XRT_STEREO_FORMAT_NONE,
205  XRT_STEREO_FORMAT_SBS, //!< Side by side.
206  XRT_STEREO_FORMAT_INTERLEAVED, //!< Interleaved pixels.
207  XRT_STEREO_FORMAT_OAU, //!< Over & Under.
208 };
209 
210 /*!
211  * A quaternion with single floats.
212  *
213  * @ingroup xrt_iface math
214  */
215 struct xrt_quat
216 {
217  float x;
218  float y;
219  float z;
220  float w;
221 };
222 
223 /*!
224  * Identity value for @ref xrt_quat
225  *
226  * @ingroup xrt_iface math
227  * @relates xrt_quat
228  */
229 #define XRT_QUAT_IDENTITY \
230  { \
231  0.f, 0.f, 0.f, 1.f \
232  }
233 
234 /*!
235  * A 1 element vector with single floats.
236  *
237  * @ingroup xrt_iface math
238  */
239 struct xrt_vec1
240 {
241  float x;
242 };
243 
244 /*!
245  * A 2 element vector with single floats.
246  *
247  * @ingroup xrt_iface math
248  */
249 struct xrt_vec2
250 {
251  float x;
252  float y;
253 };
254 
255 /*!
256  * Represents a uv triplet for distortion, basically just three xrt_vec2.
257  *
258  * @ingroup xrt_iface_math
259  */
261 {
262  struct xrt_vec2 r, g, b;
263 };
264 
265 /*!
266  * A 3 element vector with single floats.
267  *
268  * @ingroup xrt_iface math
269  */
270 struct xrt_vec3
271 {
272  float x;
273  float y;
274  float z;
275 };
276 
277 /*!
278  * A 3 element vector with single doubles.
279  *
280  * @ingroup xrt_iface math
281  */
283 {
284  double x;
285  double y;
286  double z;
287 };
288 
289 /*!
290  * All-zero value for @ref xrt_vec3
291  *
292  * @ingroup xrt_iface math
293  * @relates xrt_vec3
294  */
295 #define XRT_VEC3_ZERO \
296  { \
297  0.f, 0.f, 0.f \
298  }
299 /*!
300  * Value for @ref xrt_vec3 with 1 in the @p x coordinate.
301  *
302  * @ingroup xrt_iface math
303  * @relates xrt_vec3
304  */
305 #define XRT_VEC3_UNIT_X \
306  { \
307  1.f, 0.f, 0.f \
308  }
309 /*!
310  * Value for @ref xrt_vec3 with 1 in the @p y coordinate.
311  *
312  * @ingroup xrt_iface math
313  * @relates xrt_vec3
314  */
315 #define XRT_VEC3_UNIT_Y \
316  { \
317  0.f, 1.f, 0.f \
318  }
319 /*!
320  * Value for @ref xrt_vec3 with 1 in the @p z coordinate.
321  *
322  * @ingroup xrt_iface math
323  * @relates xrt_vec3
324  */
325 #define XRT_VEC3_UNIT_Z \
326  { \
327  0.f, 0.f, 1.f \
328  }
329 
330 /*!
331  * A 3 element vector with 32 bit integers.
332  *
333  * @ingroup xrt_iface math
334  */
336 {
337  int32_t x;
338  int32_t y;
339  int32_t z;
340 };
341 
342 /*!
343  * A 2 element vector with 32 bit integers.
344  *
345  * @ingroup xrt_iface math
346  */
348 {
349  int32_t x;
350  int32_t y;
351 };
352 
353 /*!
354  * A 3 element colour with 8 bits per channel.
355  *
356  * @ingroup xrt_iface math
357  */
359 {
360  uint8_t r;
361  uint8_t g;
362  uint8_t b;
363 };
364 
365 /*!
366  * A 4 element colour with 8 bits per channel.
367  *
368  * @ingroup xrt_iface math
369  */
371 {
372  uint8_t r;
373  uint8_t g;
374  uint8_t b;
375  uint8_t a;
376 };
377 
378 /*!
379  * A 3 element colour with floating point channels.
380  *
381  * @ingroup xrt_iface math
382  */
384 {
385  float r;
386  float g;
387  float b;
388 };
389 
390 /*!
391  * A 4 element colour with floating point channels.
392  *
393  * @ingroup xrt_iface math
394  */
396 {
397  float r;
398  float g;
399  float b;
400  float a;
401 };
402 
403 /*!
404  * Image size.
405  *
406  * @ingroup xrt_iface math
407  */
408 struct xrt_size
409 {
410  int w;
411  int h;
412 };
413 
414 /*!
415  * Image offset.
416  *
417  * @ingroup xrt_iface math
418  */
420 {
421  int w, h;
422 };
423 
424 /*!
425  * Image rectangle.
426  *
427  * @ingroup xrt_iface math
428  */
429 struct xrt_rect
430 {
431  struct xrt_offset offset;
432  struct xrt_size extent;
433 };
434 
435 /*!
436  * Image rectangle
437  *
438  * @todo Unify xrt_rect and xrt_rect_f32 field names
439  *
440  * @ingroup xrt_iface math
441  */
443 {
444  float x, y, w, h;
445 };
446 
447 /*!
448  * Normalized image rectangle, coordinates and size in 0 .. 1 range.
449  *
450  * @ingroup xrt_iface math
451  */
453 {
454  float x, y, w, h;
455 };
456 
457 /*!
458  * A pose composed of a position and orientation.
459  *
460  * @see xrt_qaut
461  * @see xrt_vec3
462  * @ingroup xrt_iface math
463  */
464 struct xrt_pose
465 {
466  struct xrt_quat orientation;
467  struct xrt_vec3 position;
468 };
469 /*!
470  * Identity value for @ref xrt_pose
471  *
472  * @ingroup xrt_iface math
473  * @relates xrt_pose
474  */
475 #define XRT_POSE_IDENTITY \
476  { \
477  XRT_QUAT_IDENTITY, XRT_VEC3_ZERO \
478  }
479 
480 /*!
481  * Describes a projection matrix fov.
482  *
483  * @ingroup xrt_iface math
484  */
485 struct xrt_fov
486 {
487  float angle_left;
488  float angle_right;
489  float angle_up;
490  float angle_down;
491 };
492 
493 /*!
494  * The number of values in @ref xrt_matrix_2x2
495  *
496  * @ingroup xrt_iface math
497  */
498 #define XRT_MATRIX_2X2_ELEMENTS 4
499 
500 /*!
501  * The number of 2d vectors in @ref xrt_matrix_2x2
502  *
503  * @ingroup xrt_iface math
504  */
505 #define XRT_MATRIX_2X2_VECS 2
506 
507 /*!
508  * A tightly packed 2x2 matrix of floats.
509  *
510  * @ingroup xrt_iface math
511  */
513 {
514  union {
515  float v[XRT_MATRIX_2X2_ELEMENTS];
516  struct xrt_vec2 vecs[XRT_MATRIX_2X2_VECS];
517  };
518 };
519 
520 /*!
521  * The number of values in @ref xrt_matrix_3x3
522  *
523  * @ingroup xrt_iface math
524  */
525 #define XRT_MATRIX_3X3_ELEMENTS 9
526 
527 /*!
528  * A tightly packed 3x3 matrix of floats.
529  *
530  * @ingroup xrt_iface math
531  */
533 {
534  float v[XRT_MATRIX_3X3_ELEMENTS];
535 };
536 
537 /*!
538  * A tightly packed 3x3 matrix of doubles.
539  *
540  * @ingroup xrt_iface math
541  */
543 {
544  double v[XRT_MATRIX_3X3_ELEMENTS];
545 };
546 
547 /*!
548  * The number of values in a 4x4 matrix like @ref xrt_matrix_4x4 and @ref xrt_matrix_4x4_f64
549  *
550  * @ingroup xrt_iface math
551  */
552 #define XRT_MATRIX_4X4_ELEMENTS 16
553 
554 /*!
555  * A tightly packed 4x4 matrix of floats.
556  *
557  * @ingroup xrt_iface math
558  */
560 {
561  float v[XRT_MATRIX_4X4_ELEMENTS];
562 };
563 
564 /*!
565  * A tightly packed 4x4 matrix of double.
566  *
567  * @ingroup xrt_iface math
568  */
570 {
571  double v[XRT_MATRIX_4X4_ELEMENTS];
572 };
573 
574 /*!
575  * A range of API versions supported.
576  *
577  * @ingroup xrt_iface math
578  */
580 {
581  uint32_t min_major;
582  uint32_t min_minor;
583  uint32_t min_patch;
584 
585  uint32_t max_major;
586  uint32_t max_minor;
587  uint32_t max_patch;
588 };
589 
590 /*!
591  * Type of a OpenXR mapped reference space, maps to the semantic spaces on the
592  * @ref xrt_space_overseer struct. This is used to refer to indirectly for
593  * instance when letting the overseer know that an application is using a
594  * particular reference space.
595  *
596  * @ingroup xrt_iface
597  */
599 {
600  XRT_SPACE_REFERENCE_TYPE_VIEW,
601  XRT_SPACE_REFERENCE_TYPE_LOCAL,
602  XRT_SPACE_REFERENCE_TYPE_LOCAL_FLOOR,
603  XRT_SPACE_REFERENCE_TYPE_STAGE,
604  XRT_SPACE_REFERENCE_TYPE_UNBOUNDED,
605 };
606 
607 /*!
608  * The number of enumerations in @ref xrt_reference_space_type.
609  *
610  * @ingroup xrt_iface
611  */
612 #define XRT_SPACE_REFERENCE_TYPE_COUNT (XRT_SPACE_REFERENCE_TYPE_UNBOUNDED + 1)
613 
614 /*!
615  * An invalid @ref xrt_reference_space_type, since it's invalid it's not listed
616  * in the enum.
617  *
618  * @ingroup xrt_iface
619  */
620 #define XRT_SPACE_REFERENCE_TYPE_INVALID ((enum xrt_reference_space_type)(-1))
621 
622 /*!
623  * Flags of which components of a @ref xrt_space_relation is valid.
624  *
625  * @see xrt_space_relation
626  * @ingroup xrt_iface math
627  */
629 {
630  // clang-format off
631  XRT_SPACE_RELATION_ORIENTATION_VALID_BIT = (1u << 0u),
632  XRT_SPACE_RELATION_POSITION_VALID_BIT = (1u << 1u),
633  XRT_SPACE_RELATION_LINEAR_VELOCITY_VALID_BIT = (1u << 2u),
634  XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT = (1u << 3u),
635  XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT = (1u << 4u),
636  XRT_SPACE_RELATION_POSITION_TRACKED_BIT = (1u << 5u),
637  // clang-format on
638  XRT_SPACE_RELATION_BITMASK_ALL = (uint32_t)XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | //
639  (uint32_t)XRT_SPACE_RELATION_POSITION_VALID_BIT | //
640  (uint32_t)XRT_SPACE_RELATION_LINEAR_VELOCITY_VALID_BIT | //
641  (uint32_t)XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT | //
642  (uint32_t)XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | //
643  (uint32_t)XRT_SPACE_RELATION_POSITION_TRACKED_BIT,
644  XRT_SPACE_RELATION_BITMASK_NONE = 0,
645 };
646 
647 /*!
648  * A relation with two spaces, includes velocity and acceleration.
649  *
650  * @see xrt_quat
651  * @see xrt_vec3
652  * @see xrt_pose
653  * @see xrt_space_relation_flags
654  * @ingroup xrt_iface math
655  */
657 {
658  enum xrt_space_relation_flags relation_flags;
659  struct xrt_pose pose;
660  struct xrt_vec3 linear_velocity;
661  struct xrt_vec3 angular_velocity;
662 };
663 
664 /*!
665  * A zero/identity value for @ref xrt_space_relation
666  *
667  * @note Despite this initializing all members (to zero or identity), this sets the xrt_space_relation::relation_flags
668  * to XRT_SPACE_RELATION_BITMASK_NONE - so this is safe to assign before an error return, etc.
669  *
670  * @ingroup xrt_iface math
671  * @relates xrt_space_relation
672  */
673 #define XRT_SPACE_RELATION_ZERO \
674  { \
675  XRT_SPACE_RELATION_BITMASK_NONE, XRT_POSE_IDENTITY, XRT_VEC3_ZERO, XRT_VEC3_ZERO \
676  }
677 
678 /*!
679  * The maximum number of steps that can be in a relation chain.
680  *
681  * @see xrt_relation_chain::steps
682  * @relates xrt_relation_chain
683  * @ingroup xrt_iface math
684  */
685 #define XRT_RELATION_CHAIN_CAPACITY 8
686 
687 /*!
688  * A chain of space relations and their associated validity flags.
689  * Functions for manipulating this are available in `math/m_space.h`.
690  *
691  * @see xrt_space_relation
692  * @ingroup xrt_iface math
693  */
695 {
697  uint32_t step_count;
698 };
699 
700 
701 /*
702  *
703  * Input related enums and structs.
704  *
705  */
706 
707 /*!
708  * A enum that is used to name devices so that the
709  * state trackers can reason about the devices easier.
710  */
712 {
713  XRT_DEVICE_INVALID = 0,
714 
715  XRT_DEVICE_GENERIC_HMD = 1,
716 
717  // Vive stuff.
718  XRT_DEVICE_VIVE_PRO,
719  XRT_DEVICE_VIVE_WAND,
720  XRT_DEVICE_VIVE_TRACKER, // Generic, only used for bindings.
721  XRT_DEVICE_VIVE_TRACKER_GEN1,
722  XRT_DEVICE_VIVE_TRACKER_GEN2,
723  XRT_DEVICE_VIVE_TRACKER_GEN3,
724  XRT_DEVICE_VIVE_TRACKER_TUNDRA,
725 
726  // "Controllers" somewhat sorted as listed in spec.
727  XRT_DEVICE_SIMPLE_CONTROLLER,
728  XRT_DEVICE_DAYDREAM,
729  XRT_DEVICE_WMR_CONTROLLER,
730  XRT_DEVICE_XBOX_CONTROLLER,
731  XRT_DEVICE_GO_CONTROLLER,
732  XRT_DEVICE_TOUCH_CONTROLLER,
733  XRT_DEVICE_INDEX_CONTROLLER,
734 
735  XRT_DEVICE_HP_REVERB_G2_CONTROLLER,
736  XRT_DEVICE_SAMSUNG_ODYSSEY_CONTROLLER,
737  XRT_DEVICE_ML2_CONTROLLER,
738  XRT_DEVICE_OPPO_MR_CONTROLLER,
739 
740  XRT_DEVICE_HAND_INTERACTION,
741 
742  XRT_DEVICE_EYE_GAZE_INTERACTION,
743 
744  XRT_DEVICE_PSMV,
745  XRT_DEVICE_PSSENSE,
746  XRT_DEVICE_HYDRA,
747 
748  // Other misc stuff.
749  XRT_DEVICE_HAND_TRACKER,
750  XRT_DEVICE_REALSENSE,
751  XRT_DEVICE_DEPTHAI,
752 
753  //! XR_EXT_hand_interaction
755 
756  //! XR_HTC_facial_tracking
758 };
759 
760 /*!
761  * How an xrt_device can be used.
762  *
763  * @ingroup xrt_iface
764  */
766 {
767  XRT_DEVICE_TYPE_UNKNOWN = 0,
768  XRT_DEVICE_TYPE_HMD,
769  XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER,
770  XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER,
771  XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER,
772  XRT_DEVICE_TYPE_GENERIC_TRACKER,
773  XRT_DEVICE_TYPE_HAND_TRACKER,
774  XRT_DEVICE_TYPE_EYE_TRACKER,
775  XRT_DEVICE_TYPE_FACE_TRACKER
776 };
777 
778 /*!
779  * Base type of this inputs.
780  *
781  * @ingroup xrt_iface
782  */
784 {
785  // clang-format off
786  //! Float input in [0, 1]
788  //! Float input in [-1, 1]
790  //! Vec2 input, components in [-1, 1]
792  //! Vec3 input, components in [-1, 1]
794  //! Boolean (digital, binary) input
796  //! A tracked pose
798  //! A tracked hand
800  //! A tracked face
802  // clang-format on
803 };
804 
805 /*!
806  * The number of bits reserved for the input type in @ref xrt_input_name
807  *
808  * @see xrt_input_name
809  * @ingroup xrt_iface
810  */
811 #define XRT_INPUT_TYPE_BITWIDTH 8u
812 
813 /*!
814  * The mask associated with @ref XRT_INPUT_TYPE_BITWIDTH
815  *
816  * @see xrt_input_name
817  * @ingroup xrt_iface
818  */
819 
820 #define XRT_INPUT_TYPE_BITMASK 0xffu
821 
822 /*!
823  * @brief Create an enum value for xrt_input_name that packs an ID and input
824  * type.
825  *
826  * @param id an integer
827  * @param type The suffix of an xrt_input_type value name: `XRT_INPUT_TYPE_` is
828  * prepended automatically.
829  *
830  * @see xrt_input_name
831  * @ingroup xrt_iface
832  */
833 #define XRT_INPUT_NAME(id, type) ((UINT32_C(id) << XRT_INPUT_TYPE_BITWIDTH) | (uint32_t)XRT_INPUT_TYPE_##type)
834 
835 /*!
836  * @brief Extract the xrt_input_type from an xrt_input_name.
837  *
838  * @param name A xrt_input_name value
839  *
840  * @relates xrt_input_name
841  * @returns @ref xrt_input_type
842  * @ingroup xrt_iface
843  */
844 #define XRT_GET_INPUT_TYPE(name) ((enum xrt_input_type)(name & XRT_INPUT_TYPE_BITMASK))
845 
846 /*!
847  * @brief Extract the xrt_input_name id from an xrt_input_name.
848  *
849  * @param name A xrt_input_name value
850  *
851  * @relates xrt_input_name
852  * @returns @ref xrt_input_type
853  * @ingroup xrt_iface
854  */
855 #define XRT_GET_INPUT_ID(name) ((uint32_t)(name >> XRT_INPUT_TYPE_BITWIDTH))
856 
857 // clang-format off
858 #define XRT_INPUT_LIST(_) \
859  /** Standard pose used for rendering */ \
860  _(XRT_INPUT_GENERIC_HEAD_POSE , XRT_INPUT_NAME(0x0000, POSE)) \
861  _(XRT_INPUT_GENERIC_HEAD_DETECT , XRT_INPUT_NAME(0x0001, BOOLEAN)) \
862  _(XRT_INPUT_GENERIC_HAND_TRACKING_LEFT , XRT_INPUT_NAME(0x0002, HAND_TRACKING)) \
863  _(XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT , XRT_INPUT_NAME(0x0004, HAND_TRACKING)) \
864  _(XRT_INPUT_GENERIC_TRACKER_POSE , XRT_INPUT_NAME(0x0005, POSE)) \
865  /** XR_EXT_palm_pose */ \
866  _(XRT_INPUT_GENERIC_PALM_POSE , XRT_INPUT_NAME(0x0006, POSE)) \
867 \
868  /** XR_EXT_eye_gaze_interaction */ \
869  _(XRT_INPUT_GENERIC_EYE_GAZE_POSE , XRT_INPUT_NAME(0x0007, POSE)) \
870  /** Standard non-view reference spaces */ \
871  _(XRT_INPUT_GENERIC_LOCAL_SPACE_POSE , XRT_INPUT_NAME(0x0008, POSE)) \
872  _(XRT_INPUT_GENERIC_LOCAL_FLOOR_SPACE_POSE , XRT_INPUT_NAME(0x0009, POSE)) \
873  _(XRT_INPUT_GENERIC_STAGE_SPACE_POSE , XRT_INPUT_NAME(0x000A, POSE)) \
874  _(XRT_INPUT_GENERIC_UNBOUNDED_SPACE_POSE , XRT_INPUT_NAME(0x000B, POSE)) \
875 \
876  _(XRT_INPUT_SIMPLE_SELECT_CLICK , XRT_INPUT_NAME(0x0010, BOOLEAN)) \
877  _(XRT_INPUT_SIMPLE_MENU_CLICK , XRT_INPUT_NAME(0x0011, BOOLEAN)) \
878  _(XRT_INPUT_SIMPLE_GRIP_POSE , XRT_INPUT_NAME(0x0012, POSE)) \
879  _(XRT_INPUT_SIMPLE_AIM_POSE , XRT_INPUT_NAME(0x0013, POSE)) \
880 \
881  _(XRT_INPUT_PSMV_PS_CLICK , XRT_INPUT_NAME(0x0020, BOOLEAN)) \
882  _(XRT_INPUT_PSMV_MOVE_CLICK , XRT_INPUT_NAME(0x0021, BOOLEAN)) \
883  _(XRT_INPUT_PSMV_START_CLICK , XRT_INPUT_NAME(0x0022, BOOLEAN)) \
884  _(XRT_INPUT_PSMV_SELECT_CLICK , XRT_INPUT_NAME(0x0023, BOOLEAN)) \
885  _(XRT_INPUT_PSMV_SQUARE_CLICK , XRT_INPUT_NAME(0x0024, BOOLEAN)) \
886  _(XRT_INPUT_PSMV_CROSS_CLICK , XRT_INPUT_NAME(0x0025, BOOLEAN)) \
887  _(XRT_INPUT_PSMV_CIRCLE_CLICK , XRT_INPUT_NAME(0x0026, BOOLEAN)) \
888  _(XRT_INPUT_PSMV_TRIANGLE_CLICK , XRT_INPUT_NAME(0x0027, BOOLEAN)) \
889  _(XRT_INPUT_PSMV_TRIGGER_VALUE , XRT_INPUT_NAME(0x0028, VEC1_ZERO_TO_ONE)) \
890  _(XRT_INPUT_PSMV_GRIP_POSE , XRT_INPUT_NAME(0x0029, POSE)) \
891  _(XRT_INPUT_PSMV_AIM_POSE , XRT_INPUT_NAME(0x002A, POSE)) \
892  _(XRT_INPUT_PSMV_BODY_CENTER_POSE , XRT_INPUT_NAME(0x002B, POSE)) \
893  _(XRT_INPUT_PSMV_BALL_CENTER_POSE , XRT_INPUT_NAME(0x002C, POSE)) \
894 \
895  _(XRT_INPUT_HYDRA_1_CLICK , XRT_INPUT_NAME(0x0030, BOOLEAN)) \
896  _(XRT_INPUT_HYDRA_2_CLICK , XRT_INPUT_NAME(0x0031, BOOLEAN)) \
897  _(XRT_INPUT_HYDRA_3_CLICK , XRT_INPUT_NAME(0x0032, BOOLEAN)) \
898  _(XRT_INPUT_HYDRA_4_CLICK , XRT_INPUT_NAME(0x0033, BOOLEAN)) \
899  _(XRT_INPUT_HYDRA_MIDDLE_CLICK , XRT_INPUT_NAME(0x0034, BOOLEAN)) \
900  _(XRT_INPUT_HYDRA_BUMPER_CLICK , XRT_INPUT_NAME(0x0035, BOOLEAN)) \
901  _(XRT_INPUT_HYDRA_JOYSTICK_CLICK , XRT_INPUT_NAME(0x0036, BOOLEAN)) \
902  _(XRT_INPUT_HYDRA_JOYSTICK_VALUE , XRT_INPUT_NAME(0x0037, VEC2_MINUS_ONE_TO_ONE)) \
903  _(XRT_INPUT_HYDRA_TRIGGER_VALUE , XRT_INPUT_NAME(0x0038, VEC1_ZERO_TO_ONE)) \
904  _(XRT_INPUT_HYDRA_POSE , XRT_INPUT_NAME(0x0039, POSE)) \
905 \
906  _(XRT_INPUT_DAYDREAM_TOUCHPAD_CLICK , XRT_INPUT_NAME(0x0040, BOOLEAN)) \
907  _(XRT_INPUT_DAYDREAM_BAR_CLICK , XRT_INPUT_NAME(0x0041, BOOLEAN)) \
908  _(XRT_INPUT_DAYDREAM_CIRCLE_CLICK , XRT_INPUT_NAME(0x0042, BOOLEAN)) \
909  _(XRT_INPUT_DAYDREAM_VOLUP_CLICK , XRT_INPUT_NAME(0x0043, BOOLEAN)) \
910  _(XRT_INPUT_DAYDREAM_VOLDN_CLICK , XRT_INPUT_NAME(0x0044, BOOLEAN)) \
911  _(XRT_INPUT_DAYDREAM_TOUCHPAD , XRT_INPUT_NAME(0x0045, VEC2_MINUS_ONE_TO_ONE)) \
912  _(XRT_INPUT_DAYDREAM_POSE , XRT_INPUT_NAME(0x0046, POSE)) \
913  _(XRT_INPUT_DAYDREAM_TOUCHPAD_TOUCH , XRT_INPUT_NAME(0x0047, BOOLEAN)) \
914 \
915  _(XRT_INPUT_INDEX_SYSTEM_CLICK , XRT_INPUT_NAME(0x0050, BOOLEAN)) \
916  _(XRT_INPUT_INDEX_SYSTEM_TOUCH , XRT_INPUT_NAME(0x0051, BOOLEAN)) \
917  _(XRT_INPUT_INDEX_A_CLICK , XRT_INPUT_NAME(0x0052, BOOLEAN)) \
918  _(XRT_INPUT_INDEX_A_TOUCH , XRT_INPUT_NAME(0x0053, BOOLEAN)) \
919  _(XRT_INPUT_INDEX_B_CLICK , XRT_INPUT_NAME(0x0054, BOOLEAN)) \
920  _(XRT_INPUT_INDEX_B_TOUCH , XRT_INPUT_NAME(0x0055, BOOLEAN)) \
921  _(XRT_INPUT_INDEX_SQUEEZE_VALUE , XRT_INPUT_NAME(0x0056, VEC1_ZERO_TO_ONE)) \
922  _(XRT_INPUT_INDEX_SQUEEZE_FORCE , XRT_INPUT_NAME(0x0057, VEC1_ZERO_TO_ONE)) \
923  _(XRT_INPUT_INDEX_TRIGGER_CLICK , XRT_INPUT_NAME(0x0058, BOOLEAN)) \
924  _(XRT_INPUT_INDEX_TRIGGER_VALUE , XRT_INPUT_NAME(0x0059, VEC1_ZERO_TO_ONE)) \
925  _(XRT_INPUT_INDEX_TRIGGER_TOUCH , XRT_INPUT_NAME(0x005A, BOOLEAN)) \
926  _(XRT_INPUT_INDEX_THUMBSTICK , XRT_INPUT_NAME(0x005B, VEC2_MINUS_ONE_TO_ONE)) \
927  _(XRT_INPUT_INDEX_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x005D, BOOLEAN)) \
928  _(XRT_INPUT_INDEX_THUMBSTICK_TOUCH , XRT_INPUT_NAME(0x005E, BOOLEAN)) \
929  _(XRT_INPUT_INDEX_TRACKPAD , XRT_INPUT_NAME(0x005F, VEC2_MINUS_ONE_TO_ONE)) \
930  _(XRT_INPUT_INDEX_TRACKPAD_FORCE , XRT_INPUT_NAME(0x0061, VEC1_ZERO_TO_ONE)) \
931  _(XRT_INPUT_INDEX_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0062, BOOLEAN)) \
932  _(XRT_INPUT_INDEX_GRIP_POSE , XRT_INPUT_NAME(0x0063, POSE)) \
933  _(XRT_INPUT_INDEX_AIM_POSE , XRT_INPUT_NAME(0x0064, POSE)) \
934 \
935  _(XRT_INPUT_VIVE_SYSTEM_CLICK , XRT_INPUT_NAME(0x0070, BOOLEAN)) \
936  _(XRT_INPUT_VIVE_SQUEEZE_CLICK , XRT_INPUT_NAME(0x0071, BOOLEAN)) \
937  _(XRT_INPUT_VIVE_MENU_CLICK , XRT_INPUT_NAME(0x0072, BOOLEAN)) \
938  _(XRT_INPUT_VIVE_TRIGGER_CLICK , XRT_INPUT_NAME(0x0073, BOOLEAN)) \
939  _(XRT_INPUT_VIVE_TRIGGER_VALUE , XRT_INPUT_NAME(0x0074, VEC1_ZERO_TO_ONE)) \
940  _(XRT_INPUT_VIVE_TRACKPAD , XRT_INPUT_NAME(0x0075, VEC2_MINUS_ONE_TO_ONE)) \
941  _(XRT_INPUT_VIVE_TRACKPAD_CLICK , XRT_INPUT_NAME(0x0076, BOOLEAN)) \
942  _(XRT_INPUT_VIVE_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0077, BOOLEAN)) \
943  _(XRT_INPUT_VIVE_GRIP_POSE , XRT_INPUT_NAME(0x0078, POSE)) \
944  _(XRT_INPUT_VIVE_AIM_POSE , XRT_INPUT_NAME(0x0079, POSE)) \
945 \
946  _(XRT_INPUT_VIVEPRO_SYSTEM_CLICK , XRT_INPUT_NAME(0x0080, BOOLEAN)) \
947  _(XRT_INPUT_VIVEPRO_VOLUP_CLICK , XRT_INPUT_NAME(0x0081, BOOLEAN)) \
948  _(XRT_INPUT_VIVEPRO_VOLDN_CLICK , XRT_INPUT_NAME(0x0082, BOOLEAN)) \
949  _(XRT_INPUT_VIVEPRO_MUTE_MIC_CLICK , XRT_INPUT_NAME(0x0083, BOOLEAN)) \
950 \
951  _(XRT_INPUT_WMR_MENU_CLICK , XRT_INPUT_NAME(0x0090, BOOLEAN)) \
952  _(XRT_INPUT_WMR_SQUEEZE_CLICK , XRT_INPUT_NAME(0x0091, BOOLEAN)) \
953  _(XRT_INPUT_WMR_TRIGGER_VALUE , XRT_INPUT_NAME(0x0092, VEC1_ZERO_TO_ONE)) \
954  _(XRT_INPUT_WMR_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x0093, BOOLEAN)) \
955  _(XRT_INPUT_WMR_THUMBSTICK , XRT_INPUT_NAME(0x0094, VEC2_MINUS_ONE_TO_ONE)) \
956  _(XRT_INPUT_WMR_TRACKPAD_CLICK , XRT_INPUT_NAME(0x0095, BOOLEAN)) \
957  _(XRT_INPUT_WMR_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0096, BOOLEAN)) \
958  _(XRT_INPUT_WMR_TRACKPAD , XRT_INPUT_NAME(0x0097, VEC2_MINUS_ONE_TO_ONE)) \
959  _(XRT_INPUT_WMR_GRIP_POSE , XRT_INPUT_NAME(0x0098, POSE)) \
960  _(XRT_INPUT_WMR_AIM_POSE , XRT_INPUT_NAME(0x0099, POSE)) \
961  _(XRT_INPUT_WMR_HOME_CLICK , XRT_INPUT_NAME(0x009A, BOOLEAN)) \
962 \
963  _(XRT_INPUT_XBOX_MENU_CLICK , XRT_INPUT_NAME(0x00A0, BOOLEAN)) \
964  _(XRT_INPUT_XBOX_VIEW_CLICK , XRT_INPUT_NAME(0x00A1, BOOLEAN)) \
965  _(XRT_INPUT_XBOX_A_CLICK , XRT_INPUT_NAME(0x00A2, BOOLEAN)) \
966  _(XRT_INPUT_XBOX_B_CLICK , XRT_INPUT_NAME(0x00A3, BOOLEAN)) \
967  _(XRT_INPUT_XBOX_X_CLICK , XRT_INPUT_NAME(0x00A4, BOOLEAN)) \
968  _(XRT_INPUT_XBOX_Y_CLICK , XRT_INPUT_NAME(0x00A5, BOOLEAN)) \
969  _(XRT_INPUT_XBOX_DPAD_DOWN_CLICK , XRT_INPUT_NAME(0x00A6, BOOLEAN)) \
970  _(XRT_INPUT_XBOX_DPAD_RIGHT_CLICK , XRT_INPUT_NAME(0x00A7, BOOLEAN)) \
971  _(XRT_INPUT_XBOX_DPAD_UP_CLICK , XRT_INPUT_NAME(0x00A8, BOOLEAN)) \
972  _(XRT_INPUT_XBOX_DPAD_LEFT_CLICK , XRT_INPUT_NAME(0x00A9, BOOLEAN)) \
973  _(XRT_INPUT_XBOX_SHOULDER_LEFT_CLICK , XRT_INPUT_NAME(0x00AA, BOOLEAN)) \
974  _(XRT_INPUT_XBOX_SHOULDER_RIGHT_CLICK , XRT_INPUT_NAME(0x00AB, BOOLEAN)) \
975  _(XRT_INPUT_XBOX_THUMBSTICK_LEFT_CLICK , XRT_INPUT_NAME(0x00AC, BOOLEAN)) \
976  _(XRT_INPUT_XBOX_THUMBSTICK_LEFT , XRT_INPUT_NAME(0x00AD, VEC2_MINUS_ONE_TO_ONE)) \
977  _(XRT_INPUT_XBOX_THUMBSTICK_RIGHT_CLICK , XRT_INPUT_NAME(0x00AE, BOOLEAN)) \
978  _(XRT_INPUT_XBOX_THUMBSTICK_RIGHT , XRT_INPUT_NAME(0x00AF, VEC2_MINUS_ONE_TO_ONE)) \
979  _(XRT_INPUT_XBOX_LEFT_TRIGGER_VALUE , XRT_INPUT_NAME(0x00B0, VEC1_ZERO_TO_ONE)) \
980  _(XRT_INPUT_XBOX_RIGHT_TRIGGER_VALUE , XRT_INPUT_NAME(0x00B1, VEC1_ZERO_TO_ONE)) \
981 \
982  _(XRT_INPUT_GO_SYSTEM_CLICK , XRT_INPUT_NAME(0x00B0, BOOLEAN)) \
983  _(XRT_INPUT_GO_TRIGGER_CLICK , XRT_INPUT_NAME(0x00B1, BOOLEAN)) \
984  _(XRT_INPUT_GO_BACK_CLICK , XRT_INPUT_NAME(0x00B2, BOOLEAN)) \
985  _(XRT_INPUT_GO_TRACKPAD_CLICK , XRT_INPUT_NAME(0x00B3, BOOLEAN)) \
986  _(XRT_INPUT_GO_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x00B4, BOOLEAN)) \
987  _(XRT_INPUT_GO_TRACKPAD , XRT_INPUT_NAME(0x00B5, VEC2_MINUS_ONE_TO_ONE)) \
988  _(XRT_INPUT_GO_GRIP_POSE , XRT_INPUT_NAME(0x00B6, POSE)) \
989  _(XRT_INPUT_GO_AIM_POSE , XRT_INPUT_NAME(0x00B7, POSE)) \
990 \
991  _(XRT_INPUT_TOUCH_X_CLICK , XRT_INPUT_NAME(0x00C0, BOOLEAN)) \
992  _(XRT_INPUT_TOUCH_X_TOUCH , XRT_INPUT_NAME(0x00C1, BOOLEAN)) \
993  _(XRT_INPUT_TOUCH_Y_CLICK , XRT_INPUT_NAME(0x00C2, BOOLEAN)) \
994  _(XRT_INPUT_TOUCH_Y_TOUCH , XRT_INPUT_NAME(0x00C3, BOOLEAN)) \
995  _(XRT_INPUT_TOUCH_MENU_CLICK , XRT_INPUT_NAME(0x00C4, BOOLEAN)) \
996  _(XRT_INPUT_TOUCH_A_CLICK , XRT_INPUT_NAME(0x00C5, BOOLEAN)) \
997  _(XRT_INPUT_TOUCH_A_TOUCH , XRT_INPUT_NAME(0x00C6, BOOLEAN)) \
998  _(XRT_INPUT_TOUCH_B_CLICK , XRT_INPUT_NAME(0x00C7, BOOLEAN)) \
999  _(XRT_INPUT_TOUCH_B_TOUCH , XRT_INPUT_NAME(0x00C8, BOOLEAN)) \
1000  _(XRT_INPUT_TOUCH_SYSTEM_CLICK , XRT_INPUT_NAME(0x00C9, BOOLEAN)) \
1001  _(XRT_INPUT_TOUCH_SQUEEZE_VALUE , XRT_INPUT_NAME(0x00CA, VEC1_ZERO_TO_ONE)) \
1002  _(XRT_INPUT_TOUCH_TRIGGER_TOUCH , XRT_INPUT_NAME(0x00CB, BOOLEAN)) \
1003  _(XRT_INPUT_TOUCH_TRIGGER_VALUE , XRT_INPUT_NAME(0x00CC, VEC1_ZERO_TO_ONE)) \
1004  _(XRT_INPUT_TOUCH_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x00CD, BOOLEAN)) \
1005  _(XRT_INPUT_TOUCH_THUMBSTICK_TOUCH , XRT_INPUT_NAME(0x00CE, BOOLEAN)) \
1006  _(XRT_INPUT_TOUCH_THUMBSTICK , XRT_INPUT_NAME(0x00CF, VEC2_MINUS_ONE_TO_ONE)) \
1007  _(XRT_INPUT_TOUCH_THUMBREST_TOUCH , XRT_INPUT_NAME(0x00D0, BOOLEAN)) \
1008  _(XRT_INPUT_TOUCH_GRIP_POSE , XRT_INPUT_NAME(0x00D1, POSE)) \
1009  _(XRT_INPUT_TOUCH_AIM_POSE , XRT_INPUT_NAME(0x00D2, POSE)) \
1010 \
1011  _(XRT_INPUT_HAND_SELECT_VALUE , XRT_INPUT_NAME(0x00E0, VEC1_ZERO_TO_ONE)) \
1012  _(XRT_INPUT_HAND_SQUEEZE_VALUE , XRT_INPUT_NAME(0x00E1, VEC1_ZERO_TO_ONE)) \
1013  _(XRT_INPUT_HAND_GRIP_POSE , XRT_INPUT_NAME(0x00E2, POSE)) \
1014  _(XRT_INPUT_HAND_AIM_POSE , XRT_INPUT_NAME(0x00E3, POSE)) \
1015 \
1016  _(XRT_INPUT_G2_CONTROLLER_X_CLICK , XRT_INPUT_NAME(0x00F0, BOOLEAN)) \
1017  _(XRT_INPUT_G2_CONTROLLER_Y_CLICK , XRT_INPUT_NAME(0x00F1, BOOLEAN)) \
1018  _(XRT_INPUT_G2_CONTROLLER_A_CLICK , XRT_INPUT_NAME(0x00F2, BOOLEAN)) \
1019  _(XRT_INPUT_G2_CONTROLLER_B_CLICK , XRT_INPUT_NAME(0x00F3, BOOLEAN)) \
1020  _(XRT_INPUT_G2_CONTROLLER_MENU_CLICK , XRT_INPUT_NAME(0x00F4, BOOLEAN)) \
1021  _(XRT_INPUT_G2_CONTROLLER_SQUEEZE_VALUE , XRT_INPUT_NAME(0x00F5, VEC1_ZERO_TO_ONE)) \
1022  _(XRT_INPUT_G2_CONTROLLER_TRIGGER_VALUE , XRT_INPUT_NAME(0x00F6, VEC1_ZERO_TO_ONE)) \
1023  _(XRT_INPUT_G2_CONTROLLER_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x00F7, BOOLEAN)) \
1024  _(XRT_INPUT_G2_CONTROLLER_THUMBSTICK , XRT_INPUT_NAME(0x00F8, VEC2_MINUS_ONE_TO_ONE)) \
1025  _(XRT_INPUT_G2_CONTROLLER_GRIP_POSE , XRT_INPUT_NAME(0x00F9, POSE)) \
1026  _(XRT_INPUT_G2_CONTROLLER_AIM_POSE , XRT_INPUT_NAME(0x00FA, POSE)) \
1027  _(XRT_INPUT_G2_CONTROLLER_HOME_CLICK , XRT_INPUT_NAME(0x00FB, BOOLEAN)) \
1028  _(XRT_INPUT_G2_CONTROLLER_SQUEEZE_CLICK , XRT_INPUT_NAME(0x00FC, BOOLEAN)) \
1029 \
1030  _(XRT_INPUT_ODYSSEY_CONTROLLER_MENU_CLICK , XRT_INPUT_NAME(0x0100, BOOLEAN)) \
1031  _(XRT_INPUT_ODYSSEY_CONTROLLER_SQUEEZE_CLICK , XRT_INPUT_NAME(0x0101, BOOLEAN)) \
1032  _(XRT_INPUT_ODYSSEY_CONTROLLER_TRIGGER_VALUE , XRT_INPUT_NAME(0x0102, VEC1_ZERO_TO_ONE)) \
1033  _(XRT_INPUT_ODYSSEY_CONTROLLER_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x0103, BOOLEAN)) \
1034  _(XRT_INPUT_ODYSSEY_CONTROLLER_THUMBSTICK , XRT_INPUT_NAME(0x0104, VEC2_MINUS_ONE_TO_ONE)) \
1035  _(XRT_INPUT_ODYSSEY_CONTROLLER_TRACKPAD_CLICK , XRT_INPUT_NAME(0x0105, BOOLEAN)) \
1036  _(XRT_INPUT_ODYSSEY_CONTROLLER_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0106, BOOLEAN)) \
1037  _(XRT_INPUT_ODYSSEY_CONTROLLER_TRACKPAD , XRT_INPUT_NAME(0x0107, VEC2_MINUS_ONE_TO_ONE)) \
1038  _(XRT_INPUT_ODYSSEY_CONTROLLER_GRIP_POSE , XRT_INPUT_NAME(0x0108, POSE)) \
1039  _(XRT_INPUT_ODYSSEY_CONTROLLER_AIM_POSE , XRT_INPUT_NAME(0x0109, POSE)) \
1040  _(XRT_INPUT_ODYSSEY_CONTROLLER_HOME_CLICK , XRT_INPUT_NAME(0x010A, BOOLEAN)) \
1041 \
1042  _(XRT_INPUT_ML2_CONTROLLER_MENU_CLICK , XRT_INPUT_NAME(0x0200, BOOLEAN)) \
1043  _(XRT_INPUT_ML2_CONTROLLER_SELECT_CLICK , XRT_INPUT_NAME(0x0201, BOOLEAN)) \
1044  _(XRT_INPUT_ML2_CONTROLLER_TRIGGER_CLICK , XRT_INPUT_NAME(0x0202, BOOLEAN)) \
1045  _(XRT_INPUT_ML2_CONTROLLER_TRIGGER_VALUE , XRT_INPUT_NAME(0x0203, VEC1_ZERO_TO_ONE)) \
1046  _(XRT_INPUT_ML2_CONTROLLER_TRACKPAD_CLICK , XRT_INPUT_NAME(0x0204, BOOLEAN)) \
1047  _(XRT_INPUT_ML2_CONTROLLER_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0205, BOOLEAN)) \
1048  _(XRT_INPUT_ML2_CONTROLLER_TRACKPAD_FORCE , XRT_INPUT_NAME(0x0206, VEC1_ZERO_TO_ONE)) \
1049  _(XRT_INPUT_ML2_CONTROLLER_TRACKPAD , XRT_INPUT_NAME(0x0207, VEC2_MINUS_ONE_TO_ONE)) \
1050  _(XRT_INPUT_ML2_CONTROLLER_GRIP_POSE , XRT_INPUT_NAME(0x0208, POSE)) \
1051  _(XRT_INPUT_ML2_CONTROLLER_AIM_POSE , XRT_INPUT_NAME(0x0209, POSE)) \
1052  _(XRT_INPUT_ML2_CONTROLLER_SHOULDER_CLICK , XRT_INPUT_NAME(0x020A, BOOLEAN)) \
1053 \
1054  _(XRT_INPUT_VIVE_TRACKER_SYSTEM_CLICK , XRT_INPUT_NAME(0x0210, BOOLEAN)) \
1055  _(XRT_INPUT_VIVE_TRACKER_MENU_CLICK , XRT_INPUT_NAME(0x0211, BOOLEAN)) \
1056  _(XRT_INPUT_VIVE_TRACKER_TRIGGER_CLICK , XRT_INPUT_NAME(0x0212, BOOLEAN)) \
1057  _(XRT_INPUT_VIVE_TRACKER_SQUEEZE_CLICK , XRT_INPUT_NAME(0x0213, BOOLEAN)) \
1058  _(XRT_INPUT_VIVE_TRACKER_TRIGGER_VALUE , XRT_INPUT_NAME(0x0214, VEC1_ZERO_TO_ONE)) \
1059  _(XRT_INPUT_VIVE_TRACKER_TRACKPAD , XRT_INPUT_NAME(0x0215, VEC2_MINUS_ONE_TO_ONE)) \
1060  _(XRT_INPUT_VIVE_TRACKER_TRACKPAD_CLICK , XRT_INPUT_NAME(0x0216, BOOLEAN)) \
1061  _(XRT_INPUT_VIVE_TRACKER_TRACKPAD_TOUCH , XRT_INPUT_NAME(0x0217, BOOLEAN)) \
1062  _(XRT_INPUT_VIVE_TRACKER_GRIP_POSE , XRT_INPUT_NAME(0x0218, POSE)) \
1063 \
1064  _(XRT_INPUT_PSSENSE_PS_CLICK , XRT_INPUT_NAME(0x0300, BOOLEAN)) \
1065  _(XRT_INPUT_PSSENSE_SHARE_CLICK , XRT_INPUT_NAME(0x0301, BOOLEAN)) \
1066  _(XRT_INPUT_PSSENSE_OPTIONS_CLICK , XRT_INPUT_NAME(0x0302, BOOLEAN)) \
1067  _(XRT_INPUT_PSSENSE_SQUARE_CLICK , XRT_INPUT_NAME(0x0303, BOOLEAN)) \
1068  _(XRT_INPUT_PSSENSE_SQUARE_TOUCH , XRT_INPUT_NAME(0x0304, BOOLEAN)) \
1069  _(XRT_INPUT_PSSENSE_TRIANGLE_CLICK , XRT_INPUT_NAME(0x0305, BOOLEAN)) \
1070  _(XRT_INPUT_PSSENSE_TRIANGLE_TOUCH , XRT_INPUT_NAME(0x0306, BOOLEAN)) \
1071  _(XRT_INPUT_PSSENSE_CROSS_CLICK , XRT_INPUT_NAME(0x0307, BOOLEAN)) \
1072  _(XRT_INPUT_PSSENSE_CROSS_TOUCH , XRT_INPUT_NAME(0x0308, BOOLEAN)) \
1073  _(XRT_INPUT_PSSENSE_CIRCLE_CLICK , XRT_INPUT_NAME(0x0309, BOOLEAN)) \
1074  _(XRT_INPUT_PSSENSE_CIRCLE_TOUCH , XRT_INPUT_NAME(0x030a, BOOLEAN)) \
1075  _(XRT_INPUT_PSSENSE_SQUEEZE_CLICK , XRT_INPUT_NAME(0x030b, BOOLEAN)) \
1076  _(XRT_INPUT_PSSENSE_SQUEEZE_TOUCH , XRT_INPUT_NAME(0x030c, BOOLEAN)) \
1077  _(XRT_INPUT_PSSENSE_SQUEEZE_PROXIMITY , XRT_INPUT_NAME(0x030d, VEC1_ZERO_TO_ONE)) \
1078  _(XRT_INPUT_PSSENSE_TRIGGER_CLICK , XRT_INPUT_NAME(0x030e, BOOLEAN)) \
1079  _(XRT_INPUT_PSSENSE_TRIGGER_TOUCH , XRT_INPUT_NAME(0x030f, BOOLEAN)) \
1080  _(XRT_INPUT_PSSENSE_TRIGGER_VALUE , XRT_INPUT_NAME(0x0310, VEC1_ZERO_TO_ONE)) \
1081  _(XRT_INPUT_PSSENSE_TRIGGER_PROXIMITY , XRT_INPUT_NAME(0x0311, VEC1_ZERO_TO_ONE)) \
1082  _(XRT_INPUT_PSSENSE_THUMBSTICK , XRT_INPUT_NAME(0x0312, VEC2_MINUS_ONE_TO_ONE)) \
1083  _(XRT_INPUT_PSSENSE_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x0313, BOOLEAN)) \
1084  _(XRT_INPUT_PSSENSE_THUMBSTICK_TOUCH , XRT_INPUT_NAME(0x0314, BOOLEAN)) \
1085  _(XRT_INPUT_PSSENSE_GRIP_POSE , XRT_INPUT_NAME(0x0315, POSE)) \
1086  _(XRT_INPUT_PSSENSE_AIM_POSE , XRT_INPUT_NAME(0x0316, POSE)) \
1087 \
1088  /** XR_EXT_hand_interaction */ \
1089  _(XRT_INPUT_HAND_PINCH_POSE , XRT_INPUT_NAME(0x0401, POSE)) \
1090  _(XRT_INPUT_HAND_POKE_POSE , XRT_INPUT_NAME(0x0402, POSE)) \
1091  _(XRT_INPUT_HAND_PINCH_VALUE , XRT_INPUT_NAME(0x0403, VEC1_ZERO_TO_ONE)) \
1092  _(XRT_INPUT_HAND_AIM_ACTIVATE_VALUE , XRT_INPUT_NAME(0x0404, VEC1_ZERO_TO_ONE)) \
1093  _(XRT_INPUT_HAND_GRASP_VALUE , XRT_INPUT_NAME(0x0405, VEC1_ZERO_TO_ONE)) \
1094  _(XRT_INPUT_HAND_PINCH_READY , XRT_INPUT_NAME(0x0406, BOOLEAN)) \
1095  _(XRT_INPUT_HAND_AIM_ACTIVATE_READY , XRT_INPUT_NAME(0x0407, BOOLEAN)) \
1096  _(XRT_INPUT_HAND_GRASP_READY , XRT_INPUT_NAME(0x0408, BOOLEAN)) \
1097 \
1098  _(XRT_INPUT_OPPO_MR_X_CLICK , XRT_INPUT_NAME(0x0500, BOOLEAN)) \
1099  _(XRT_INPUT_OPPO_MR_X_TOUCH , XRT_INPUT_NAME(0x0501, BOOLEAN)) \
1100  _(XRT_INPUT_OPPO_MR_Y_CLICK , XRT_INPUT_NAME(0x0502, BOOLEAN)) \
1101  _(XRT_INPUT_OPPO_MR_Y_TOUCH , XRT_INPUT_NAME(0x0503, BOOLEAN)) \
1102  _(XRT_INPUT_OPPO_MR_MENU_CLICK , XRT_INPUT_NAME(0x0504, BOOLEAN)) \
1103  _(XRT_INPUT_OPPO_MR_HEART_RATE_VALUE , XRT_INPUT_NAME(0x0505, VEC1_ZERO_TO_ONE)) \
1104  _(XRT_INPUT_OPPO_MR_A_CLICK , XRT_INPUT_NAME(0x0506, BOOLEAN)) \
1105  _(XRT_INPUT_OPPO_MR_A_TOUCH , XRT_INPUT_NAME(0x0507, BOOLEAN)) \
1106  _(XRT_INPUT_OPPO_MR_B_CLICK , XRT_INPUT_NAME(0x0508, BOOLEAN)) \
1107  _(XRT_INPUT_OPPO_MR_B_TOUCH , XRT_INPUT_NAME(0x0509, BOOLEAN)) \
1108  _(XRT_INPUT_OPPO_MR_HOME_CLICK , XRT_INPUT_NAME(0x050A, BOOLEAN)) \
1109  _(XRT_INPUT_OPPO_MR_SQUEEZE_VALUE , XRT_INPUT_NAME(0x050B, VEC1_ZERO_TO_ONE)) \
1110  _(XRT_INPUT_OPPO_MR_TRIGGER_TOUCH , XRT_INPUT_NAME(0x050C, BOOLEAN)) \
1111  _(XRT_INPUT_OPPO_MR_TRIGGER_VALUE , XRT_INPUT_NAME(0x050D, VEC1_ZERO_TO_ONE)) \
1112  _(XRT_INPUT_OPPO_MR_GRIP_POSE , XRT_INPUT_NAME(0x050E, POSE)) \
1113  _(XRT_INPUT_OPPO_MR_AIM_POSE , XRT_INPUT_NAME(0x050F, POSE)) \
1114  _(XRT_INPUT_OPPO_MR_THUMBSTICK_CLICK , XRT_INPUT_NAME(0x0510, BOOLEAN)) \
1115  _(XRT_INPUT_OPPO_MR_THUMBSTICK_TOUCH , XRT_INPUT_NAME(0x0511, BOOLEAN)) \
1116  _(XRT_INPUT_OPPO_MR_THUMBSTICK , XRT_INPUT_NAME(0x0512, VEC2_MINUS_ONE_TO_ONE)) \
1117 \
1118  _(XRT_INPUT_GENERIC_FACE_TRACKING , XRT_INPUT_NAME(0x0600, FACE_TRACKING)) \
1119 \
1120  _(XRT_INPUT_HTC_EYE_FACE_TRACKING , XRT_INPUT_NAME(0x0601, FACE_TRACKING)) \
1121  _(XRT_INPUT_HTC_LIP_FACE_TRACKING , XRT_INPUT_NAME(0x0602, FACE_TRACKING))
1122 
1123 // clang-format on
1124 
1125 
1126 /*!
1127  * Every internal input source known to monado with a baked in type.
1128  * Values are maintained in XRT_INPUT_LIST.
1129  *
1130  * @see xrt_input_type
1131  * @ingroup xrt_iface
1132  */
1134 {
1135 #define XRT_INPUT_LIST_TO_NAME_VALUE(NAME, VALUE) NAME = VALUE,
1136 
1137  XRT_INPUT_LIST(XRT_INPUT_LIST_TO_NAME_VALUE)
1138 
1139 #undef XRT_INPUT_LIST_TO_NAME_VALUE
1140 };
1141 
1142 /*!
1143  * Number of joints in a hand. Corresponds to XR_HAND_JOINT_COUNT_EXT.
1144  *
1145  * @see xrt_hand_joint
1146  * @ingroup xrt_iface
1147  */
1148 #define XRT_HAND_JOINT_COUNT 26
1149 
1150 /*!
1151  * Number of joints in a hand. Corresponds to XrHandJointEXT.
1152  *
1153  * @ingroup xrt_iface
1154  */
1155 enum xrt_hand_joint
1156 {
1157  XRT_HAND_JOINT_PALM = 0,
1158  XRT_HAND_JOINT_WRIST = 1,
1159  XRT_HAND_JOINT_THUMB_METACARPAL = 2,
1160  XRT_HAND_JOINT_THUMB_PROXIMAL = 3,
1161  XRT_HAND_JOINT_THUMB_DISTAL = 4,
1162  XRT_HAND_JOINT_THUMB_TIP = 5,
1163  XRT_HAND_JOINT_INDEX_METACARPAL = 6,
1164  XRT_HAND_JOINT_INDEX_PROXIMAL = 7,
1165  XRT_HAND_JOINT_INDEX_INTERMEDIATE = 8,
1166  XRT_HAND_JOINT_INDEX_DISTAL = 9,
1167  XRT_HAND_JOINT_INDEX_TIP = 10,
1168  XRT_HAND_JOINT_MIDDLE_METACARPAL = 11,
1169  XRT_HAND_JOINT_MIDDLE_PROXIMAL = 12,
1170  XRT_HAND_JOINT_MIDDLE_INTERMEDIATE = 13,
1171  XRT_HAND_JOINT_MIDDLE_DISTAL = 14,
1172  XRT_HAND_JOINT_MIDDLE_TIP = 15,
1173  XRT_HAND_JOINT_RING_METACARPAL = 16,
1174  XRT_HAND_JOINT_RING_PROXIMAL = 17,
1175  XRT_HAND_JOINT_RING_INTERMEDIATE = 18,
1176  XRT_HAND_JOINT_RING_DISTAL = 19,
1177  XRT_HAND_JOINT_RING_TIP = 20,
1178  XRT_HAND_JOINT_LITTLE_METACARPAL = 21,
1179  XRT_HAND_JOINT_LITTLE_PROXIMAL = 22,
1180  XRT_HAND_JOINT_LITTLE_INTERMEDIATE = 23,
1181  XRT_HAND_JOINT_LITTLE_DISTAL = 24,
1182  XRT_HAND_JOINT_LITTLE_TIP = 25,
1183  XRT_HAND_JOINT_MAX_ENUM = 0x7FFFFFFF
1184 };
1185 
1186 /*!
1187  * Enumeration for left and right hand.
1188  *
1189  * @ingroup xrt_iface
1190  */
1191 enum xrt_hand
1192 {
1193  XRT_HAND_LEFT = 0,
1194  XRT_HAND_RIGHT = 1,
1195 };
1196 
1197 /*!
1198  * Location of a single hand joint. Corresponds to XrHandJointLocationEXT.
1199  *
1200  * @ingroup xrt_iface
1201  */
1202 struct xrt_hand_joint_value
1203 {
1204  struct xrt_space_relation relation;
1205  float radius;
1206 };
1207 
1208 /*!
1209  * Number of fingers on a hand.
1210  *
1211  * @ingroup xrt_iface
1212  */
1213 #define XRT_FINGER_COUNT 5
1214 
1215 /*!
1216  * Names for fingers on a hand.
1217  *
1218  * @ingroup xrt_iface
1219  */
1220 enum xrt_finger
1221 {
1222  XRT_FINGER_LITTLE = 0,
1223  XRT_FINGER_RING,
1224  XRT_FINGER_MIDDLE,
1225  XRT_FINGER_INDEX,
1226  XRT_FINGER_THUMB
1227 };
1228 
1229 /*!
1230  * Joint set type used for hand tracking. Corresponds to XrHandJointSetEXT.
1231  *
1232  * @ingroup xrt_iface
1233  */
1234 struct xrt_hand_joint_set
1235 {
1236  union {
1237  struct xrt_hand_joint_value hand_joint_set_default[XRT_HAND_JOINT_COUNT];
1238  } values;
1239 
1240  // in driver global space, without tracking_origin offset
1241  struct xrt_space_relation hand_pose;
1242  bool is_active;
1243 };
1244 
1245 /*!
1246  * A union of all input types.
1247  *
1248  * @see xrt_input_type
1249  * @ingroup xrt_iface math
1250  */
1251 union xrt_input_value {
1252  struct xrt_vec1 vec1;
1253  struct xrt_vec2 vec2;
1254  bool boolean;
1255 };
1256 
1257 /*!
1258  * The number of bits reserved for the input type in @ref xrt_output_name
1259  * @see xrt_output_type
1260  * @ingroup xrt_iface
1261  */
1262 #define XRT_OUTPUT_TYPE_BITWIDTH 8u
1263 
1264 /*!
1265  * The mask associated with @ref XRT_OUTPUT_TYPE_BITWIDTH
1266  * @see xrt_output_type
1267  * @ingroup xrt_iface
1268  */
1269 #define XRT_OUTPUT_TYPE_BITMASK 0xffu
1270 
1271 /*!
1272  * Base type of this output.
1273  *
1274  * @ingroup xrt_iface
1275  */
1276 enum xrt_output_type
1277 {
1278  // clang-format off
1279  XRT_OUTPUT_TYPE_VIBRATION = 0x00,
1280  XRT_OUTPUT_TYPE_FORCE_FEEDBACK = 0x01,
1281  // clang-format on
1282 };
1283 
1284 #define XRT_OUTPUT_NAME(id, type) ((UINT32_C(id) << XRT_OUTPUT_TYPE_BITWIDTH) | (uint32_t)XRT_OUTPUT_TYPE_##type)
1285 
1286 enum xrt_eye_expression_htc
1287 {
1288  XRT_EYE_EXPRESSION_LEFT_BLINK_HTC = 0,
1289  XRT_EYE_EXPRESSION_LEFT_WIDE_HTC = 1,
1290  XRT_EYE_EXPRESSION_RIGHT_BLINK_HTC = 2,
1291  XRT_EYE_EXPRESSION_RIGHT_WIDE_HTC = 3,
1292  XRT_EYE_EXPRESSION_LEFT_SQUEEZE_HTC = 4,
1293  XRT_EYE_EXPRESSION_RIGHT_SQUEEZE_HTC = 5,
1294  XRT_EYE_EXPRESSION_LEFT_DOWN_HTC = 6,
1295  XRT_EYE_EXPRESSION_RIGHT_DOWN_HTC = 7,
1296  XRT_EYE_EXPRESSION_LEFT_OUT_HTC = 8,
1297  XRT_EYE_EXPRESSION_RIGHT_IN_HTC = 9,
1298  XRT_EYE_EXPRESSION_LEFT_IN_HTC = 10,
1299  XRT_EYE_EXPRESSION_RIGHT_OUT_HTC = 11,
1300  XRT_EYE_EXPRESSION_LEFT_UP_HTC = 12,
1301  XRT_EYE_EXPRESSION_RIGHT_UP_HTC = 13
1302 };
1303 
1304 enum xrt_lip_expression_htc
1305 {
1306  XRT_LIP_EXPRESSION_JAW_RIGHT_HTC = 0,
1307  XRT_LIP_EXPRESSION_JAW_LEFT_HTC = 1,
1308  XRT_LIP_EXPRESSION_JAW_FORWARD_HTC = 2,
1309  XRT_LIP_EXPRESSION_JAW_OPEN_HTC = 3,
1310  XRT_LIP_EXPRESSION_MOUTH_APE_SHAPE_HTC = 4,
1311  XRT_LIP_EXPRESSION_MOUTH_UPPER_RIGHT_HTC = 5,
1312  XRT_LIP_EXPRESSION_MOUTH_UPPER_LEFT_HTC = 6,
1313  XRT_LIP_EXPRESSION_MOUTH_LOWER_RIGHT_HTC = 7,
1314  XRT_LIP_EXPRESSION_MOUTH_LOWER_LEFT_HTC = 8,
1315  XRT_LIP_EXPRESSION_MOUTH_UPPER_OVERTURN_HTC = 9,
1316  XRT_LIP_EXPRESSION_MOUTH_LOWER_OVERTURN_HTC = 10,
1317  XRT_LIP_EXPRESSION_MOUTH_POUT_HTC = 11,
1318  XRT_LIP_EXPRESSION_MOUTH_SMILE_RIGHT_HTC = 12,
1319  XRT_LIP_EXPRESSION_MOUTH_SMILE_LEFT_HTC = 13,
1320  XRT_LIP_EXPRESSION_MOUTH_SAD_RIGHT_HTC = 14,
1321  XRT_LIP_EXPRESSION_MOUTH_SAD_LEFT_HTC = 15,
1322  XRT_LIP_EXPRESSION_CHEEK_PUFF_RIGHT_HTC = 16,
1323  XRT_LIP_EXPRESSION_CHEEK_PUFF_LEFT_HTC = 17,
1324  XRT_LIP_EXPRESSION_CHEEK_SUCK_HTC = 18,
1325  XRT_LIP_EXPRESSION_MOUTH_UPPER_UPRIGHT_HTC = 19,
1326  XRT_LIP_EXPRESSION_MOUTH_UPPER_UPLEFT_HTC = 20,
1327  XRT_LIP_EXPRESSION_MOUTH_LOWER_DOWNRIGHT_HTC = 21,
1328  XRT_LIP_EXPRESSION_MOUTH_LOWER_DOWNLEFT_HTC = 22,
1329  XRT_LIP_EXPRESSION_MOUTH_UPPER_INSIDE_HTC = 23,
1330  XRT_LIP_EXPRESSION_MOUTH_LOWER_INSIDE_HTC = 24,
1331  XRT_LIP_EXPRESSION_MOUTH_LOWER_OVERLAY_HTC = 25,
1332  XRT_LIP_EXPRESSION_TONGUE_LONGSTEP1_HTC = 26,
1333  XRT_LIP_EXPRESSION_TONGUE_LEFT_HTC = 27,
1334  XRT_LIP_EXPRESSION_TONGUE_RIGHT_HTC = 28,
1335  XRT_LIP_EXPRESSION_TONGUE_UP_HTC = 29,
1336  XRT_LIP_EXPRESSION_TONGUE_DOWN_HTC = 30,
1337  XRT_LIP_EXPRESSION_TONGUE_ROLL_HTC = 31,
1338  XRT_LIP_EXPRESSION_TONGUE_LONGSTEP2_HTC = 32,
1339  XRT_LIP_EXPRESSION_TONGUE_UPRIGHT_MORPH_HTC = 33,
1340  XRT_LIP_EXPRESSION_TONGUE_UPLEFT_MORPH_HTC = 34,
1341  XRT_LIP_EXPRESSION_TONGUE_DOWNRIGHT_MORPH_HTC = 35,
1342  XRT_LIP_EXPRESSION_TONGUE_DOWNLEFT_MORPH_HTC = 36
1343 };
1344 
1345 enum xrt_facial_tracking_type_htc
1346 {
1347  XRT_FACIAL_TRACKING_TYPE_EYE_DEFAULT_HTC = 1,
1348  XRT_FACIAL_TRACKING_TYPE_LIP_DEFAULT_HTC = 2
1349 };
1350 
1351 #define XRT_FACIAL_EXPRESSION_EYE_COUNT_HTC 14
1352 #define XRT_FACIAL_EXPRESSION_LIP_COUNT_HTC 37
1353 
1355 {
1356  uint64_t sample_time_ns;
1357  bool is_active;
1358 };
1359 
1361 {
1363  // ordered by xrt_eye_expression_htc
1364  float expression_weights[XRT_FACIAL_EXPRESSION_EYE_COUNT_HTC];
1365 };
1366 
1368 {
1370  // ordered by xrt_lip_expression_htc
1371  float expression_weights[XRT_FACIAL_EXPRESSION_LIP_COUNT_HTC];
1372 };
1373 
1375 {
1376  union {
1377  struct xrt_facial_base_expression_set_htc base_expression_set_htc;
1378  struct xrt_facial_eye_expression_set_htc eye_expression_set_htc;
1379  struct xrt_facial_lip_expression_set_htc lip_expression_set_htc;
1380  };
1381 };
1382 
1383 /*!
1384  * Name of a output with a baked in type.
1385  *
1386  * @see xrt_output_type
1387  * @ingroup xrt_iface
1388  */
1389 enum xrt_output_name
1390 {
1391  // clang-format off
1392  XRT_OUTPUT_NAME_SIMPLE_VIBRATION = XRT_OUTPUT_NAME(0x0010, VIBRATION),
1393  XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION = XRT_OUTPUT_NAME(0x0020, VIBRATION),
1394  XRT_OUTPUT_NAME_INDEX_HAPTIC = XRT_OUTPUT_NAME(0x0030, VIBRATION),
1395  XRT_OUTPUT_NAME_VIVE_HAPTIC = XRT_OUTPUT_NAME(0x0040, VIBRATION),
1396  XRT_OUTPUT_NAME_WMR_HAPTIC = XRT_OUTPUT_NAME(0x0050, VIBRATION),
1397 
1398  XRT_OUTPUT_NAME_XBOX_HAPTIC_LEFT = XRT_OUTPUT_NAME(0x0060, VIBRATION),
1399  XRT_OUTPUT_NAME_XBOX_HAPTIC_RIGHT = XRT_OUTPUT_NAME(0x0061, VIBRATION),
1400  XRT_OUTPUT_NAME_XBOX_HAPTIC_LEFT_TRIGGER = XRT_OUTPUT_NAME(0x0062, VIBRATION),
1401  XRT_OUTPUT_NAME_XBOX_HAPTIC_RIGHT_TRIGGER = XRT_OUTPUT_NAME(0x0063, VIBRATION),
1402 
1403  XRT_OUTPUT_NAME_TOUCH_HAPTIC = XRT_OUTPUT_NAME(0x0070, VIBRATION),
1404 
1405  XRT_OUTPUT_NAME_FORCE_FEEDBACK_LEFT = XRT_OUTPUT_NAME(0x0080, FORCE_FEEDBACK),
1406  XRT_OUTPUT_NAME_FORCE_FEEDBACK_RIGHT = XRT_OUTPUT_NAME(0x0081, FORCE_FEEDBACK),
1407 
1408  XRT_OUTPUT_NAME_G2_CONTROLLER_HAPTIC = XRT_OUTPUT_NAME(0x0090, VIBRATION),
1409  XRT_OUTPUT_NAME_ODYSSEY_CONTROLLER_HAPTIC = XRT_OUTPUT_NAME(0x00A0, VIBRATION),
1410  XRT_OUTPUT_NAME_ML2_CONTROLLER_VIBRATION = XRT_OUTPUT_NAME(0x00B0, VIBRATION),
1411 
1412  XRT_OUTPUT_NAME_PSSENSE_VIBRATION = XRT_OUTPUT_NAME(0x00C0, VIBRATION),
1413  XRT_OUTPUT_NAME_PSSENSE_TRIGGER_FEEDBACK = XRT_OUTPUT_NAME(0x00C1, FORCE_FEEDBACK),
1414 
1415  XRT_OUTPUT_NAME_VIVE_TRACKER_HAPTIC = XRT_OUTPUT_NAME(0x00D0, VIBRATION),
1416 
1417  XRT_OUTPUT_NAME_OPPO_MR_HAPTIC = XRT_OUTPUT_NAME(0x00E0, VIBRATION),
1418  // clang-format on
1419 };
1420 
1421 /*!
1422  * Value used to indicate a haptic pulse of the minimal supported duration.
1423  *
1424  * @ingroup xrt_iface
1425  */
1426 #define XRT_MIN_HAPTIC_DURATION -1
1427 
1428 /*!
1429  * Value used to indicate a haptic pulse of some runtime defined optimal
1430  * frequency.
1431  *
1432  * @ingroup xrt_iface
1433  */
1434 
1435 #define XRT_FREQUENCY_UNSPECIFIED 0
1436 
1437 /*!
1438  * Value used as a timeout to indicate the timeout should never occur.
1439  *
1440  * @ingroup xrt_iface
1441  */
1442 #define XRT_INFINITE_DURATION (0x7fffffffffffffffLL)
1443 
1444 enum xrt_force_feedback_location
1445 {
1446  XRT_FORCE_FEEDBACK_LOCATION_LEFT_THUMB,
1447  XRT_FORCE_FEEDBACK_LOCATION_LEFT_INDEX,
1448  XRT_FORCE_FEEDBACK_LOCATION_LEFT_MIDDLE,
1449  XRT_FORCE_FEEDBACK_LOCATION_LEFT_RING,
1450  XRT_FORCE_FEEDBACK_LOCATION_LEFT_PINKY,
1451 };
1452 
1454 {
1455  float value;
1456  enum xrt_force_feedback_location location;
1457 };
1458 
1459 /*!
1460  * A union of all output types.
1461  *
1462  * @see xrt_output_type
1463  * @ingroup xrt_iface math
1464  */
1465 union xrt_output_value {
1466  struct
1467  {
1468  float frequency;
1469  float amplitude;
1470  int64_t duration_ns;
1471  } vibration;
1472 
1473  struct
1474  {
1475  struct xrt_output_force_feedback force_feedback[5];
1476  uint64_t force_feedback_location_count;
1477  } force_feedback;
1478 };
1479 
1480 
1481 /*
1482  *
1483  * Misc enums.
1484  *
1485  */
1486 
1487 /*!
1488  * What form factor is this device, mostly maps onto OpenXR's @p XrFormFactor.
1489  *
1490  * @ingroup xrt_iface
1491  */
1494  XRT_FORM_FACTOR_HMD, //!< Head mounted display.
1495  XRT_FORM_FACTOR_HANDHELD, //!< Handheld display.
1496 };
1497 
1498 /*!
1499  * Domain type.
1500  * Use for performance level setting
1501  * Which hardware should be boost/decrease
1502  */
1503 enum xrt_perf_domain
1504 {
1505  XRT_PERF_DOMAIN_CPU = 1,
1506  XRT_PERF_DOMAIN_GPU = 2,
1507 };
1508 
1509 enum xrt_perf_sub_domain
1510 {
1511  XRT_PERF_SUB_DOMAIN_COMPOSITING = 1,
1512  XRT_PERF_SUB_DOMAIN_RENDERING = 2,
1513  XRT_PERF_SUB_DOMAIN_THERMAL = 3
1514 };
1515 
1516 /*!
1517  * Performance level.
1518  */
1519 enum xrt_perf_set_level
1520 {
1521  XRT_PERF_SET_LEVEL_POWER_SAVINGS = 0,
1522  XRT_PERF_SET_LEVEL_SUSTAINED_LOW = 25,
1523  XRT_PERF_SET_LEVEL_SUSTAINED_HIGH = 50,
1524  XRT_PERF_SET_LEVEL_BOOST = 75,
1525 };
1526 
1527 /*!
1528  * Performance level.
1529  */
1531 {
1532  XRT_PERF_NOTIFY_LEVEL_NORMAL = 0,
1533  XRT_PERF_NOTIFY_LEVEL_WARNING = 25,
1534  XRT_PERF_NOTIFY_LEVEL_IMPAIRED = 75,
1535 };
1536 
1537 /*!
1538  * Visibility mask, mirror of XrVisibilityMaskKHR
1539  *
1540  * @ingroup xrt_iface
1541  */
1543 {
1544  XRT_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH = 1,
1545  XRT_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH = 2,
1546  XRT_VISIBILITY_MASK_TYPE_LINE_LOOP = 3,
1547 };
1548 
1549 
1550 /*
1551  *
1552  * Inline functions
1553  *
1554  */
1555 
1556 /*!
1557  * Increment the reference, probably want @ref xrt_reference_inc_and_was_zero.
1558  *
1559  * @memberof xrt_reference
1560  * @ingroup xrt_iface
1561  */
1562 static inline void
1563 xrt_reference_inc(struct xrt_reference *xref)
1564 {
1565  xrt_atomic_s32_inc_return(&xref->count);
1566 }
1567 
1568 /*!
1569  * Decrement the reference, probably want @ref xrt_reference_dec_and_is_zero.
1570  *
1571  * @memberof xrt_reference
1572  * @ingroup xrt_iface
1573  */
1574 static inline void
1575 xrt_reference_dec(struct xrt_reference *xref)
1576 {
1577  xrt_atomic_s32_dec_return(&xref->count);
1578 }
1579 
1580 /*!
1581  * Increment the reference and return true if the value @p was zero.
1582  *
1583  * @memberof xrt_reference
1584  * @ingroup xrt_iface
1585  */
1586 XRT_CHECK_RESULT static inline bool
1588 {
1589  int32_t count = xrt_atomic_s32_inc_return(&xref->count);
1590  return count == 1;
1591 }
1592 
1593 /*!
1594  * Decrement the reference and return true if the value is now zero.
1595  *
1596  * @memberof xrt_reference
1597  * @ingroup xrt_iface
1598  */
1599 XRT_CHECK_RESULT static inline bool
1601 {
1602  int32_t count = xrt_atomic_s32_dec_return(&xref->count);
1603  return count == 0;
1604 }
1605 
1606 
1607 #ifdef __cplusplus
1608 }
1609 #endif
xrt_input_type
Base type of this inputs.
Definition: xrt_defines.h:784
xrt_hand
Enumeration for left and right hand.
Definition: xrt_defines.h:1190
#define XRT_MATRIX_3X3_ELEMENTS
The number of values in xrt_matrix_3x3.
Definition: xrt_defines.h:525
xrt_stereo_format
What type of stereo format a frame has.
Definition: xrt_defines.h:203
xrt_visibility_mask_type
Visibility mask, mirror of XrVisibilityMaskKHR.
Definition: xrt_defines.h:1541
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition: xrt_defines.h:109
static XRT_CHECK_RESULT bool xrt_reference_dec_and_is_zero(struct xrt_reference *xref)
Decrement the reference and return true if the value is now zero.
Definition: xrt_defines.h:1598
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition: xrt_defines.h:1491
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1134
xrt_output_type
Base type of this output.
Definition: xrt_defines.h:1275
static XRT_CHECK_RESULT bool xrt_reference_inc_and_was_zero(struct xrt_reference *xref)
Increment the reference and return true if the value was zero.
Definition: xrt_defines.h:1585
#define XRT_UUID_SIZE
Internal define for VK_UUID_SIZE and XR_UUID_SIZE_EXT.
Definition: xrt_defines.h:28
#define XRT_MATRIX_2X2_ELEMENTS
The number of values in xrt_matrix_2x2.
Definition: xrt_defines.h:498
static void xrt_reference_inc(struct xrt_reference *xref)
Increment the reference, probably want xrt_reference_inc_and_was_zero.
Definition: xrt_defines.h:1561
#define XRT_MATRIX_2X2_VECS
The number of 2d vectors in xrt_matrix_2x2.
Definition: xrt_defines.h:505
#define XRT_LUID_SIZE
Internal define for VK_LUID_SIZE.
Definition: xrt_defines.h:52
static void xrt_reference_dec(struct xrt_reference *xref)
Decrement the reference, probably want xrt_reference_dec_and_is_zero.
Definition: xrt_defines.h:1573
xrt_reference_space_type
Type of a OpenXR mapped reference space, maps to the semantic spaces on the xrt_space_overseer struct...
Definition: xrt_defines.h:599
#define XRT_HAND_JOINT_COUNT
Number of joints in a hand.
Definition: xrt_defines.h:1146
xrt_output_name
Name of a output with a baked in type.
Definition: xrt_defines.h:1388
xrt_finger
Names for fingers on a hand.
Definition: xrt_defines.h:1219
xrt_hand_joint
Number of joints in a hand.
Definition: xrt_defines.h:1154
#define XRT_MATRIX_4X4_ELEMENTS
The number of values in a 4x4 matrix like xrt_matrix_4x4 and xrt_matrix_4x4_f64.
Definition: xrt_defines.h:552
xrt_space_relation_flags
Flags of which components of a xrt_space_relation is valid.
Definition: xrt_defines.h:629
xrt_device_type
How an xrt_device can be used.
Definition: xrt_defines.h:766
@ XRT_INPUT_TYPE_POSE
A tracked pose.
Definition: xrt_defines.h:797
@ XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE
Vec2 input, components in [-1, 1].
Definition: xrt_defines.h:791
@ XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE
Vec3 input, components in [-1, 1].
Definition: xrt_defines.h:793
@ XRT_INPUT_TYPE_FACE_TRACKING
A tracked face.
Definition: xrt_defines.h:801
@ XRT_INPUT_TYPE_HAND_TRACKING
A tracked hand.
Definition: xrt_defines.h:799
@ XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE
Float input in [-1, 1].
Definition: xrt_defines.h:789
@ XRT_INPUT_TYPE_BOOLEAN
Boolean (digital, binary) input.
Definition: xrt_defines.h:795
@ XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE
Float input in [0, 1].
Definition: xrt_defines.h:787
@ XRT_STEREO_FORMAT_OAU
Over & Under.
Definition: xrt_defines.h:207
@ XRT_STEREO_FORMAT_SBS
Side by side.
Definition: xrt_defines.h:205
@ XRT_STEREO_FORMAT_INTERLEAVED
Interleaved pixels.
Definition: xrt_defines.h:206
@ XRT_FORM_FACTOR_HANDHELD
Handheld display.
Definition: xrt_defines.h:1493
@ XRT_FORM_FACTOR_HMD
Head mounted display.
Definition: xrt_defines.h:1492
static Eigen::Map< const Eigen::Vector3f > position(const struct xrt_pose &pose)
Return a Eigen type wrapping a pose's position (const).
Definition: m_eigen_interop.hpp:217
static Eigen::Map< const Eigen::Quaternionf > orientation(const struct xrt_pose &pose)
Return a Eigen type wrapping a pose's orientation (const).
Definition: m_eigen_interop.hpp:199
A range of API versions supported.
Definition: xrt_defines.h:580
A 3 element colour with floating point channels.
Definition: xrt_defines.h:384
A 3 element colour with 8 bits per channel.
Definition: xrt_defines.h:359
A 4 element colour with floating point channels.
Definition: xrt_defines.h:396
A 4 element colour with 8 bits per channel.
Definition: xrt_defines.h:371
Definition: xrt_defines.h:1353
Definition: xrt_defines.h:1373
Definition: xrt_defines.h:1359
Definition: xrt_defines.h:1366
Describes a projection matrix fov.
Definition: xrt_defines.h:486
Joint set type used for hand tracking.
Definition: xrt_defines.h:1233
Location of a single hand joint.
Definition: xrt_defines.h:1201
A limited unique id, it is only unique for the process it is in, so must not be used or synchronized ...
Definition: xrt_defines.h:79
To transport LUIDs between different APIs.
Definition: xrt_defines.h:60
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:513
A tightly packed 3x3 matrix of doubles.
Definition: xrt_defines.h:543
A tightly packed 3x3 matrix of floats.
Definition: xrt_defines.h:533
A tightly packed 4x4 matrix of double.
Definition: xrt_defines.h:570
A tightly packed 4x4 matrix of floats.
Definition: xrt_defines.h:560
Normalized image rectangle, coordinates and size in 0 .
Definition: xrt_defines.h:453
Image offset.
Definition: xrt_defines.h:420
Definition: xrt_defines.h:1452
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
A quaternion with single floats.
Definition: xrt_defines.h:216
Image rectangle.
Definition: xrt_defines.h:443
Image rectangle.
Definition: xrt_defines.h:430
A base class for reference counted objects.
Definition: xrt_defines.h:96
A chain of space relations and their associated validity flags.
Definition: xrt_defines.h:695
#define XRT_RELATION_CHAIN_CAPACITY
The maximum number of steps that can be in a relation chain.
Definition: xrt_defines.h:685
Image size.
Definition: xrt_defines.h:409
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:657
To transport UUIDs between different APIs.
Definition: xrt_defines.h:36
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition: xrt_defines.h:261
A 1 element vector with single floats.
Definition: xrt_defines.h:240
A 2 element vector with 32 bit integers.
Definition: xrt_defines.h:348
A 2 element vector with single floats.
Definition: xrt_defines.h:250
A 3 element vector with single doubles.
Definition: xrt_defines.h:283
A 3 element vector with 32 bit integers.
Definition: xrt_defines.h:336
A 3 element vector with single floats.
Definition: xrt_defines.h:271
A union of all input types.
Definition: xrt_defines.h:1249
A union of all output types.
Definition: xrt_defines.h:1463
Header holding common defines.
xrt_perf_notify_level
Performance level.
Definition: xrt_defines.h:1529
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value.
Definition: xrt_defines.h:164
xrt_passthrough_purpose_flags
Specify the kind of passthrough behavior the layer provides.
Definition: xrt_defines.h:148
@ XRT_PASSTHROUGH_LAYER_PURPOSE_TRACKED_KEYBOARD_MASKED_HANDS
Provided by XR_FB_passthrough_keyboard_hands.
Definition: xrt_defines.h:156
@ XRT_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION
Fullscreen layer.
Definition: xrt_defines.h:150
@ XRT_PASSTHROUGH_LAYER_PURPOSE_TRACKED_KEYBOARD_HANDS
Provided by XR_FB_passthrough_keyboard_hands.
Definition: xrt_defines.h:154
@ XRT_PASSTHROUGH_LAYER_PURPOSE_PROJECTED
Projected layer.
Definition: xrt_defines.h:152
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition: xrt_defines.h:712
@ XRT_DEVICE_HTC_FACE_TRACKING
XR_HTC_facial_tracking.
Definition: xrt_defines.h:757
@ XRT_DEVICE_EXT_HAND_INTERACTION
XR_EXT_hand_interaction.
Definition: xrt_defines.h:754
xrt_perf_domain
Domain type.
Definition: xrt_defines.h:1502
xrt_passthrough_state
Specify additional state change behavior.
Definition: xrt_defines.h:133
@ XRT_PASSTHROUGH_STATE_CHANGED_NON_RECOVERABLE_ERROR_BIT
Non-recoverable error has occurred.
Definition: xrt_defines.h:137
@ XRT_PASSTHROUGH_STATE_CHANGED_RESTORED_ERROR_BIT
The runtime has recovered from a previous error and is functioning normally.
Definition: xrt_defines.h:141
@ XRT_PASSTHROUGH_STATE_CHANGED_REINIT_REQUIRED_BIT
Passthrough system requires reinitialization.
Definition: xrt_defines.h:135
@ XRT_PASSTHROUGH_STATE_CHANGED_RECOVERABLE_ERROR_BIT
A recoverable error has occurred.
Definition: xrt_defines.h:139
xrt_format
Common formats, use u_format_* functions to reason about them.
Definition: xrt_defines.h:176
xrt_passthrough_create_flags
Special flags for creating passthrough.
Definition: xrt_defines.h:122
@ XRT_PASSTHROUGH_LAYER_DEPTH
Our compositor just ignores this bit.
Definition: xrt_defines.h:126
@ XRT_PASSTHROUGH_IS_RUNNING_AT_CREATION
Start the passthrough on creation.
Definition: xrt_defines.h:124
xrt_perf_set_level
Performance level.
Definition: xrt_defines.h:1518
Internal result type for XRT.