26#define XRT_DEVICE_NAME_LEN 256
166 size_t blend_mode_count;
192 uint32_t index_counts[XRT_MAX_VIEWS];
194 uint32_t index_offsets[XRT_MAX_VIEWS];
277 XRT_DEVICE_FEATURE_HAND_TRACKING_LEFT = 0,
278 XRT_DEVICE_FEATURE_HAND_TRACKING_RIGHT,
279 XRT_DEVICE_FEATURE_EYE_TRACKING,
280 XRT_DEVICE_FEATURE_FACE_TRACKING,
281 XRT_DEVICE_FEATURE_MAX_ENUM,
303 bool orientation_tracking;
304 bool position_tracking;
309 bool ref_space_usage;
310 bool form_factor_check;
313 bool face_tracking_calibration_state;
315 bool body_tracking_calibration;
316 bool body_tracking_fidelity;
318 bool brightness_control;
319 bool compositor_info;
349 char str[XRT_DEVICE_NAME_LEN];
352 char serial[XRT_DEVICE_NAME_LEN];
418 int64_t at_timestamp_ns,
446 int64_t desired_timestamp_ns,
448 int64_t *out_timestamp_ns);
464 int64_t at_timestamp_ns,
505 int64_t desired_timestamp_ns,
533 enum xrt_body_tracking_fidelity_meta new_fidelity);
574 uint64_t plane_detection_id,
575 uint64_t *out_plane_detection_id);
595 uint64_t plane_detection_id,
607 uint64_t plane_detection_id,
649 const struct xrt_vec3 *default_eye_relation,
650 int64_t at_timestamp_ns,
717 bool *out_available);
813 int64_t at_timestamp_ns,
829 int64_t desired_timestamp_ns,
831 int64_t *out_timestamp_ns)
833 return xdev->
get_hand_tracking(xdev, name, desired_timestamp_ns, out_value, out_timestamp_ns);
846 int64_t at_timestamp_ns,
849 return xdev->
get_face_tracking(xdev, facial_expression_type, at_timestamp_ns, out_value);
890 int64_t desired_timestamp_ns,
893 return xdev->
get_body_joints(xdev, body_tracking_type, desired_timestamp_ns, out_value);
993 uint64_t plane_detection_id,
994 uint64_t *out_plane_detection_id)
1017 uint64_t plane_detection_id,
1030 uint64_t plane_detection_id,
1044 const struct xrt_vec3 *default_eye_relation,
1045 int64_t at_timestamp_ns,
1047 uint32_t view_count,
1054 default_eye_relation,
1087 uint32_t view_index,
1207XRT_NONNULL_ALL
static inline void
xrt_plane_detection_capability_flags_ext
Caps for a plane detector, see xrt_device.
Definition xrt_plane_detector.h:30
xrt_visibility_mask_type
Visibility mask, mirror of XrVisibilityMaskKHR.
Definition xrt_defines.h:2468
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition xrt_defines.h:112
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition xrt_defines.h:2408
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:930
enum xrt_result xrt_result_t
Result type used across Monado.
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:625
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1612
xrt_plane_detector_state_ext
State of a plane detector, see xrt_device.
Definition xrt_plane_detector.h:83
xrt_device_type
How an xrt_device can be used.
Definition xrt_defines.h:827
@ XRT_SUCCESS
The operation succeeded.
Definition xrt_results.h:27
@ XRT_ERROR_NOT_IMPLEMENTED
The interface function called is not implemented by its interface.
Definition xrt_results.h:192
A binding pair, going from a binding point to a device output.
Definition xrt_device.h:250
enum xrt_output_name device
To output on the device.
Definition xrt_device.h:252
enum xrt_output_name from
From which name.
Definition xrt_device.h:251
A binding profile, has lists of binding pairs to goes from device in name to the device it hangs off ...
Definition xrt_device.h:262
enum xrt_device_name name
Device this binding emulates.
Definition xrt_device.h:264
Definition xrt_defines.h:2301
Definition xrt_defines.h:2198
Compositor information for a device.
Definition xrt_device.h:110
XRT_ALIGNAS(8) int64_t scanout_time_ns
The amount of time it takes to scanout the display in nanoseconds, from the start of the scanout,...
enum xrt_scanout_direction scanout_direction
The direction scanout on the display occurs.
Definition xrt_device.h:112
Compositor mode information for a device.
Definition xrt_device.h:126
int64_t frame_interval_ns
The amount of nanoseconds between frames.
Definition xrt_device.h:128
A unique identifier for an xrt_device instance.
Definition xrt_device.h:47
Static data of supported features of the xrt_device this struct sits on.
Definition xrt_device.h:302
bool get_views_quad
The device itself only has 2 views but is aware of quad views, has better knowledge of which fovs to ...
Definition xrt_device.h:329
A single HMD or input device.
Definition xrt_device.h:340
xrt_result_t(* set_body_tracking_fidelity_meta)(struct xrt_device *xdev, enum xrt_body_tracking_fidelity_meta new_fidelity)
XR_META_body_tracking_fidelity - body tracking extension for request changing the tracking fidelity.
Definition xrt_device.h:532
static XRT_NONNULL_ALL xrt_result_t xrt_device_end_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::end_feature.
Definition xrt_device.h:1195
xrt_result_t(* get_plane_detections_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Get results of a plane detection request.
Definition xrt_device.h:606
xrt_result_t(* get_body_skeleton)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc.
Definition xrt_device.h:487
xrt_result_t(* reset_body_tracking_calibration_meta)(struct xrt_device *xdev)
XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration.
Definition xrt_device.h:513
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_face_calibration_state_android(struct xrt_device *xdev, bool *out_face_is_calibrated)
Helper function for xrt_device::get_face_calibration_state_android.
Definition xrt_device.h:860
xrt_result_t(* get_body_joints)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Get the joint locations for a body tracker.
Definition xrt_device.h:503
xrt_result_t(* begin_plane_detection_ext)(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Begin a plane detection request.
Definition xrt_device.h:572
xrt_result_t(* ref_space_usage)(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Called by the xrt_space_overseer when a reference space that is implemented by this device is first u...
Definition xrt_device.h:701
xrt_result_t(* get_presence)(struct xrt_device *xdev, bool *presence)
Get current presence status of the device.
Definition xrt_device.h:561
xrt_result_t(* set_output)(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Set a output value.
Definition xrt_device.h:543
xrt_result_t(* compute_distortion)(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Compute the distortion at a single point.
Definition xrt_device.h:671
static XRT_NONNULL_ALL xrt_result_t xrt_device_begin_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::begin_feature.
Definition xrt_device.h:1182
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_visibility_mask(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Helper function for xrt_device::get_visibility_mask.
Definition xrt_device.h:1085
xrt_result_t(* set_body_tracking_calibration_override_meta)(struct xrt_device *xdev, float new_body_height)
XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration ov...
Definition xrt_device.h:522
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_plane_detections_ext(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Helper function for xrt_device::get_plane_detections_ext.
Definition xrt_device.h:1029
static XRT_NONNULL_ALL xrt_result_t xrt_device_update_inputs(struct xrt_device *xdev)
Helper function for xrt_device::update_inputs.
Definition xrt_device.h:798
xrt_result_t(* get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits)
Gets limits of this devices outputs.
Definition xrt_device.h:553
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_view_poses(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Helper function for xrt_device::get_view_poses.
Definition xrt_device.h:1043
static XRT_NONNULL_ALL xrt_result_t xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
Helper function for xrt_device::destroy_plane_detection_ext.
Definition xrt_device.h:1005
xrt_result_t(* get_hand_tracking)(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Get relationship of hand joints to the tracking origin space as the base space.
Definition xrt_device.h:444
xrt_result_t(* get_visibility_mask)(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Get the visibility mask for this device.
Definition xrt_device.h:682
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
Helper function for xrt_device::set_brightness.
Definition xrt_device.h:1154
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition xrt_device.h:355
xrt_result_t(* get_face_tracking)(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Get the requested blend shape properties & weights for a face tracker.
Definition xrt_device.h:462
xrt_result_t(* destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id)
Destroy internal resources associated with plane_detector_id.
Definition xrt_device.h:584
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_body_tracking_calibration_override_meta(struct xrt_device *xdev, float new_body_height)
Helper function for xrt_device::set_body_tracking_calibration_override_meta.
Definition xrt_device.h:920
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
Helper function for xrt_device::get_brightness.
Definition xrt_device.h:1142
struct xrt_output * outputs
Array of output structs.
Definition xrt_device.h:373
xrt_result_t(* begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Enable the feature for this device.
Definition xrt_device.h:772
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
Helper function for xrt_device::get_presence.
Definition xrt_device.h:976
size_t output_count
Number of outputs.
Definition xrt_device.h:371
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_hand_tracking(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Helper function for xrt_device::get_hand_tracking.
Definition xrt_device.h:827
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_face_tracking(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Helper function for xrt_device::get_face_tracking.
Definition xrt_device.h:844
xrt_result_t(* set_brightness)(struct xrt_device *xdev, float brightness, bool relative)
Set the display brightness.
Definition xrt_device.h:751
struct xrt_input * inputs
Array of input structs.
Definition xrt_device.h:368
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_body_skeleton(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Helper function for xrt_device::get_body_skeleton.
Definition xrt_device.h:873
size_t input_count
Number of inputs.
Definition xrt_device.h:366
xrt_result_t(* get_battery_status)(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Get battery status information.
Definition xrt_device.h:727
static XRT_NONNULL_ALL xrt_result_t xrt_device_reset_body_tracking_calibration_meta(struct xrt_device *xdev)
Helper function for xrt_device::reset_body_tracking_calibration_meta.
Definition xrt_device.h:904
void(* destroy)(struct xrt_device *xdev)
Destroy device.
Definition xrt_device.h:785
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_body_tracking_fidelity_meta(struct xrt_device *xdev, enum xrt_body_tracking_fidelity_meta new_fidelity)
Helper function for xrt_device::set_body_tracking_fidelity_meta.
Definition xrt_device.h:936
xrt_result_t(* get_brightness)(struct xrt_device *xdev, float *out_brightness)
Get the current display brightness.
Definition xrt_device.h:739
xrt_result_t(* get_compositor_info)(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Gets the compositor info for a device for the given mode.
Definition xrt_device.h:762
static XRT_NONNULL_ALL xrt_result_t xrt_device_ref_space_usage(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Helper function for xrt_device::ref_space_usage.
Definition xrt_device.h:1101
xrt_result_t(* get_plane_detection_state_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Get the state of a plane detection request.
Definition xrt_device.h:594
xrt_result_t(* update_inputs)(struct xrt_device *xdev)
Update any attached inputs.
Definition xrt_device.h:390
xrt_result_t(* get_view_poses)(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Get the per-view pose in relation to the view space.
Definition xrt_device.h:648
static XRT_NONNULL_ALL xrt_result_t xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor, bool *out_available)
Helper function for xrt_device::is_form_factor_available.
Definition xrt_device.h:1117
static XRT_NONNULL_ALL xrt_result_t xrt_device_begin_plane_detection_ext(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Helper function for xrt_device::begin_plane_detection_ext.
Definition xrt_device.h:991
xrt_result_t(* get_face_calibration_state_android)(struct xrt_device *xdev, bool *out_face_is_calibrated)
Gets the face tracking calibration state.
Definition xrt_device.h:475
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_tracked_pose(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Helper function for xrt_device::get_tracked_pose.
Definition xrt_device.h:811
struct xrt_tracking_origin * tracking_origin
Always set, pointing to the tracking system for this device.
Definition xrt_device.h:358
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Helper function for xrt_device::set_output.
Definition xrt_device.h:952
xrt_result_t(* end_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Disable the feature for this device.
Definition xrt_device.h:780
size_t binding_profile_count
Number of bindings in xrt_device::binding_profiles.
Definition xrt_device.h:361
static XRT_NONNULL_ALL void xrt_device_destroy(struct xrt_device **xdev_ptr)
Helper function for xrt_device::destroy.
Definition xrt_device.h:1208
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_compositor_info(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Helper function for xrt_device::get_compositor_info.
Definition xrt_device.h:1167
static XRT_NONNULL_ALL xrt_result_t xrt_device_compute_distortion(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Helper function for xrt_device::compute_distortion.
Definition xrt_device.h:1071
enum xrt_device_name name
Enum identifier of the device.
Definition xrt_device.h:345
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Helper function for xrt_device::get_battery_status.
Definition xrt_device.h:1130
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_plane_detection_state_ext(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Helper function for xrt_device::get_plane_detections_ext.
Definition xrt_device.h:1016
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_body_joints(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Helper function for xrt_device::get_body_joints.
Definition xrt_device.h:888
xrt_result_t(* get_tracked_pose)(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Get relationship of a tracked device to the tracking origin space as the base space.
Definition xrt_device.h:416
xrt_result_t(* is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor, bool *out_available)
Check if given form factor is available or not.
Definition xrt_device.h:715
Definition xrt_defines.h:1967
Describes a projection matrix fov.
Definition xrt_defines.h:512
Joint set type used for hand tracking.
Definition xrt_defines.h:1521
All of the device components that deals with interfacing to a users head.
Definition xrt_device.h:139
float * vertices
Data.
Definition xrt_device.h:181
uint32_t vertex_count
Number of vertices.
Definition xrt_device.h:183
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition xrt_device.h:151
uint32_t stride
Stride of vertices.
Definition xrt_device.h:185
int * indices
Indices, for triangle strip.
Definition xrt_device.h:190
enum xrt_distortion_model models
Supported distortion models, a bitfield.
Definition xrt_device.h:174
uint32_t index_count_total
Total number of elements in mesh::indices array.
Definition xrt_device.h:196
uint32_t uv_channels_count
1 or 3 for (chromatic aberration).
Definition xrt_device.h:187
enum xrt_distortion_model preferred
Preferred disortion model, single value.
Definition xrt_device.h:176
A tightly packed 2x2 matrix of floats.
Definition xrt_defines.h:539
Output limits of a particular device.
Definition xrt_device.h:288
float haptic_pcm_sample_rate
The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
Definition xrt_device.h:290
A union of all output types.
Definition xrt_defines.h:2386
A single named output, that sits on a xrt_device.
Definition xrt_device.h:228
Each plane has n polygons; ultimately plane metadata from xrt_plane_detections_ext::locations and xrt...
Definition xrt_plane_detector.h:172
A query for a plane.
Definition xrt_plane_detector.h:97
A pose composed of a position and orientation.
Definition xrt_defines.h:492
A relation with two spaces, includes velocity and acceleration.
Definition xrt_defines.h:683
A tracking system or device origin.
Definition xrt_tracking.h:78
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition xrt_defines.h:279
A 3 element vector with single floats.
Definition xrt_defines.h:289
A per-lens/display view information.
Definition xrt_device.h:57
struct xrt_view::@251 display
Physical properties of this display (or the part of a display that covers this view).
struct xrt_matrix_2x2 rot
Rotation 2d matrix used to rotate the position of the output of the distortion shaders onto the scree...
Definition xrt_device.h:103
struct xrt_view::@250 viewport
Viewport position on the screen.
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition xrt_visibility_mask.h:26
Common defines and enums for XRT.
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value.
Definition xrt_defines.h:167
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:737
xrt_scanout_direction
Screen scanout direction.
Definition xrt_defines.h:179
xrt_view_type
View type to be rendered to by the compositor.
Definition xrt_defines.h:2417
xrt_device_feature_type
Higher level features for devices.
Definition xrt_device.h:276
Header for limits of the XRT interfaces.
Header defining planes detector enum and structs.
Header defining visibility mask helper struct.