Monado OpenXR Runtime
Data Fields
xrt_device Struct Reference

A single HMD or input device. More...

#include <xrt/xrt_device.h>

Collaboration diagram for xrt_device:
Collaboration graph
[legend]

Data Fields

enum xrt_device_name name
 Enum identifier of the device. More...
 
char str [XRT_DEVICE_NAME_LEN]
 A string describing the device. More...
 
struct xrt_hmd_partshmd
 Null if this device does not interface with the users head. More...
 
struct xrt_tracking_origintracking_origin
 Always set, pointing to the tracking system for this device. More...
 
size_t num_inputs
 Number of inputs. More...
 
struct xrt_inputinputs
 Array of input structs. More...
 
size_t num_outputs
 Number of outputs. More...
 
struct xrt_outputoutputs
 Array of output structs. More...
 
void(* update_inputs )(struct xrt_device *xdev, struct time_state *timekeeping)
 Update any attached inputs. More...
 
void(* get_tracked_pose )(struct xrt_device *xdev, enum xrt_input_name name, struct time_state *timekeeping, int64_t *out_timestamp, struct xrt_space_relation *out_relation)
 Get relationship of a tracked device to the device "base space". More...
 
void(* set_output )(struct xrt_device *xdev, enum xrt_output_name name, struct time_state *timekeeping, union xrt_output_value *value)
 Set a output value. More...
 
void(* get_view_pose )(struct xrt_device *xdev, struct xrt_vec3 *eye_relation, uint32_t view_index, struct xrt_pose *out_pose)
 Get the per view pose in relation to the view space. More...
 
void(* destroy )(struct xrt_device *xdev)
 Destroy device. More...
 

Detailed Description

A single HMD or input device.

Field Documentation

◆ destroy

void(* xrt_device::destroy) (struct xrt_device *xdev)

Destroy device.

◆ get_tracked_pose

void(* xrt_device::get_tracked_pose) (struct xrt_device *xdev, enum xrt_input_name name, struct time_state *timekeeping, int64_t *out_timestamp, struct xrt_space_relation *out_relation)

Get relationship of a tracked device to the device "base space".

Right now the base space is assumed to be local space.

This is very very WIP and will need to be made a lot more advanced.

Parameters
[in]xdevThe device.
[in]nameSome devices may have multiple poses on them, select the one using this field. For HMDs use XRT_INPUT_GENERIC_HEAD_POSE.
[in]timekeepingShared time synchronization struct.
[out]out_timestampTimestamp when this relation was captured.
[out]out_relationThe relation read from the device.
See also
xrt_input_name

◆ get_view_pose

void(* xrt_device::get_view_pose) (struct xrt_device *xdev, struct xrt_vec3 *eye_relation, uint32_t view_index, struct xrt_pose *out_pose)

Get the per view pose in relation to the view space.

Does not do any device level tracking, use get_tracked_pose for that.

Parameters
eye_relationThe interpupillary relation as a 3D position, most simple stereo devices would just want to set out_puse->position.[x|y|z] = ipd.[x|y|z] / 2.0f. Not to be confused with IPD that is absolute distance, this is a full 3D relation.
indexIndex of view.
out_poseOutput pose, see ipd argument, and in addition orientation most likely identity rotation.

◆ hmd

struct xrt_hmd_parts* xrt_device::hmd

Null if this device does not interface with the users head.

Referenced by u_device_free(), and u_device_setup_split_side_by_side().

◆ inputs

struct xrt_input* xrt_device::inputs

Array of input structs.

Referenced by oxr_xdev_find_input().

◆ name

enum xrt_device_name xrt_device::name

Enum identifier of the device.

Referenced by oxr_find_profile_for_device().

◆ num_inputs

size_t xrt_device::num_inputs

Number of inputs.

Referenced by oxr_xdev_find_input().

◆ num_outputs

size_t xrt_device::num_outputs

Number of outputs.

Referenced by oxr_xdev_find_output().

◆ outputs

struct xrt_output* xrt_device::outputs

Array of output structs.

Referenced by oxr_xdev_find_output().

◆ set_output

void(* xrt_device::set_output) (struct xrt_device *xdev, enum xrt_output_name name, struct time_state *timekeeping, union xrt_output_value *value)

Set a output value.

See also
xrt_output_name

◆ str

char xrt_device::str[XRT_DEVICE_NAME_LEN]

A string describing the device.

Referenced by oxr_system_get_properties().

◆ tracking_origin

struct xrt_tracking_origin* xrt_device::tracking_origin

Always set, pointing to the tracking system for this device.

Referenced by oxr_session_get_view_pose_at().

◆ update_inputs

void(* xrt_device::update_inputs) (struct xrt_device *xdev, struct time_state *timekeeping)

Update any attached inputs.

Parameters
[in]xdevThe device.
[in]timekeepingShared time synchronization struct.

The documentation for this struct was generated from the following file: