Monado OpenXR Runtime
|
A single HMD or input device. More...
#include <xrt/xrt_device.h>
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_parts * | hmd |
Null if this device does not interface with the users head. More... | |
struct xrt_tracking_origin * | tracking_origin |
Always set, pointing to the tracking system for this device. More... | |
size_t | num_inputs |
Number of inputs. More... | |
struct xrt_input * | inputs |
Array of input structs. More... | |
size_t | num_outputs |
Number of outputs. More... | |
struct xrt_output * | outputs |
Array of output structs. More... | |
void(* | update_inputs )(struct xrt_device *xdev) |
Update any attached inputs. More... | |
void(* | get_tracked_pose )(struct xrt_device *xdev, enum xrt_input_name name, uint64_t at_timestamp_ns, uint64_t *out_relation_timestamp_ns, 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, 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... | |
A single HMD or input device.
void(* xrt_device::destroy) (struct xrt_device *xdev) |
Destroy device.
Referenced by arduino_device_create(), daydream_device_create(), gui_prober_teardown(), hydra_found(), oxr_xdev_destroy(), and vive_controller_found().
void(* xrt_device::get_tracked_pose) (struct xrt_device *xdev, enum xrt_input_name name, uint64_t at_timestamp_ns, uint64_t *out_relation_timestamp_ns, 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.
[in] | xdev | The device. |
[in] | name | Some devices may have multiple poses on them, select the one using this field. For HMDs use XRT_INPUT_GENERIC_HEAD_POSE . |
[in] | at_timestamp_ns | If the device can predict or has a history of positions, this is when the caller wants the pose to be from. |
[out] | out_relation_timestamp_ns | Timestamp when this relation was captured. |
[out] | out_relation | The relation read from the device. |
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.
eye_relation | The 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. |
index | Index of view. |
out_pose | Output pose, see ipd argument, and in addition orientation most likely identity rotation. |
struct xrt_hmd_parts* xrt_device::hmd |
Null if this device does not interface with the users head.
Referenced by hdk_device_create(), u_device_dump_config(), u_device_free(), u_device_setup_split_side_by_side(), vive_device_create(), and vive_init_defaults().
struct xrt_input* xrt_device::inputs |
Array of input structs.
Referenced by oxr_xdev_find_input().
enum xrt_device_name xrt_device::name |
Enum identifier of the device.
Referenced by arduino_device_create(), daydream_device_create(), and oxr_find_profile_for_device().
size_t xrt_device::num_inputs |
Number of inputs.
Referenced by oxr_xdev_find_input(), and u_device_allocate().
size_t xrt_device::num_outputs |
Number of outputs.
Referenced by oxr_xdev_find_output().
struct xrt_output* xrt_device::outputs |
Array of output structs.
Referenced by oxr_xdev_find_output().
void(* xrt_device::set_output) (struct xrt_device *xdev, enum xrt_output_name name, union xrt_output_value *value) |
Set a output value.
char xrt_device::str[XRT_DEVICE_NAME_LEN] |
A string describing the device.
Referenced by oxr_system_get_properties().
struct xrt_tracking_origin* xrt_device::tracking_origin |
Always set, pointing to the tracking system for this device.
Referenced by hydra_found(), and oxr_xdev_get_relation_at().
void(* xrt_device::update_inputs) (struct xrt_device *xdev) |
Update any attached inputs.
[in] | xdev | The device. |
[in] | timekeeping | Shared time synchronization struct. |
Referenced by dummy_hmd_create(), gui_prober_update(), hdk_device_create(), ns_hmd_create(), oh_device_create(), oxr_xdev_update(), psvr_device_create(), rs_6dof_create(), and vive_device_create().