18#define XRT_MAX_CLIENT_SPACES 128
163 int64_t at_timestamp_ns,
185 int64_t at_timestamp_ns,
187 uint32_t space_count,
210 int64_t at_timestamp_ns,
304 struct xrt_space **out_local_floor_space);
357 int64_t at_timestamp_ns,
362 return xso->
locate_space(xso, base_space, base_offset, at_timestamp_ns, space, offset, out_relation);
376 int64_t at_timestamp_ns,
378 uint32_t space_count,
382 return xso->
locate_spaces(xso, base_space, base_offset, at_timestamp_ns, spaces, space_count, offsets,
397 int64_t at_timestamp_ns,
401 return xso->
locate_device(xso, base_space, base_offset, at_timestamp_ns, xdev, out_relation);
513 struct xrt_space **out_local_floor_space)
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:2025
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1301
enum xrt_result xrt_result_t
Result type used across Monado.
static void xrt_reference_inc(struct xrt_reference *xref)
Increment the reference, probably want xrt_reference_inc_and_was_zero.
Definition: xrt_defines.h:1988
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
static void xrt_space_reference(struct xrt_space **dst, struct xrt_space *src)
Update the reference counts on space(s).
Definition: xrt_space.h:55
A single HMD or input device.
Definition: xrt_device.h:241
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:243
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
A base class for reference counted objects.
Definition: xrt_defines.h:96
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:96
static xrt_result_t xrt_space_overseer_get_tracking_origin_offset(struct xrt_space_overseer *xso, struct xrt_tracking_origin *xto, struct xrt_pose *out_offset)
Read the offset from a tracking origin, not all implementations of xrt_space_overseer may support thi...
Definition: xrt_space.h:451
xrt_result_t(* get_reference_space_offset)(struct xrt_space_overseer *xso, enum xrt_reference_space_type type, struct xrt_pose *out_offset)
Read the offset from the given reference space, not all implementations of xrt_space_overseer may sup...
Definition: xrt_space.h:279
struct xrt_space * unbounded
Unbounded space, only here for slam trackers.
Definition: xrt_space.h:104
struct xrt_space * localspace[128]
Ptrs to the localspace.
Definition: xrt_space.h:112
xrt_result_t(* get_tracking_origin_offset)(struct xrt_space_overseer *xso, struct xrt_tracking_origin *xto, struct xrt_pose *out_offset)
Read the offset from a tracking origin, not all implementations of xrt_space_overseer may support thi...
Definition: xrt_space.h:254
void(* destroy)(struct xrt_space_overseer *xs)
Destroy function.
Definition: xrt_space.h:311
xrt_result_t(* ref_space_dec)(struct xrt_space_overseer *xso, enum xrt_reference_space_type type)
Decrement the usage count of a reference space (aka semantic space).
Definition: xrt_space.h:233
struct xrt_space * local
Local space, may be null (in very rare cases).
Definition: xrt_space.h:101
struct xrt_space * local_floor
Local floor space, may be null.
Definition: xrt_space.h:102
static xrt_result_t xrt_space_overseer_ref_space_dec(struct xrt_space_overseer *xso, enum xrt_reference_space_type type)
Decrement the usage count of a reference space (aka semantic space).
Definition: xrt_space.h:425
xrt_result_t(* create_offset_space)(struct xrt_space_overseer *xso, struct xrt_space *parent, const struct xrt_pose *offset, struct xrt_space **out_space)
Create a space with a fixed offset to the parent space.
Definition: xrt_space.h:124
struct xrt_space * view
View space, may be null (in very rare cases).
Definition: xrt_space.h:100
xrt_result_t(* locate_spaces)(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_space **spaces, uint32_t space_count, const struct xrt_pose *offsets, struct xrt_space_relation *out_relations)
Locate spaces in the base space.
Definition: xrt_space.h:182
static xrt_result_t xrt_space_overseer_set_reference_space_offset(struct xrt_space_overseer *xso, enum xrt_reference_space_type type, const struct xrt_pose *offset)
Apply an offset to the given reference space, not all implementations of xrt_space_overseer may suppo...
Definition: xrt_space.h:496
xrt_result_t(* set_tracking_origin_offset)(struct xrt_space_overseer *xso, struct xrt_tracking_origin *xto, const struct xrt_pose *offset)
Apply an offset to a tracking origin, not all implementations of xrt_space_overseer may support this.
Definition: xrt_space.h:266
static xrt_result_t xrt_space_overseer_locate_spaces(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_space **spaces, uint32_t space_count, const struct xrt_pose *offsets, struct xrt_space_relation *out_relations)
Locate spaces in the base space.
Definition: xrt_space.h:373
struct xrt_space * stage
Stage space, may be null.
Definition: xrt_space.h:103
static void xrt_space_overseer_destroy(struct xrt_space_overseer **xso_ptr)
Helper for calling through the function pointer: does a null check and sets xc_ptr to null if freed.
Definition: xrt_space.h:526
static xrt_result_t xrt_space_overseer_ref_space_inc(struct xrt_space_overseer *xso, enum xrt_reference_space_type type)
Increment the usage count of a reference space (aka semantic space).
Definition: xrt_space.h:412
xrt_result_t(* locate_space)(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_space *space, const struct xrt_pose *offset, struct xrt_space_relation *out_relation)
Locate a space in the base space.
Definition: xrt_space.h:160
xrt_result_t(* set_reference_space_offset)(struct xrt_space_overseer *xso, enum xrt_reference_space_type type, const struct xrt_pose *offset)
Apply an offset to the given reference space, not all implementations of xrt_space_overseer may suppo...
Definition: xrt_space.h:291
static xrt_result_t xrt_space_overseer_recenter_local_spaces(struct xrt_space_overseer *xso)
Trigger a re-center of the local and local_floor spaces, not all implementations of xrt_space_oversee...
Definition: xrt_space.h:438
static xrt_result_t xrt_space_overseer_create_local_space(struct xrt_space_overseer *xso, struct xrt_space **out_local_space, struct xrt_space **out_local_floor_space)
Create a localspace and a localfloorspace.
Definition: xrt_space.h:511
static xrt_result_t xrt_space_overseer_locate_space(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_space *space, const struct xrt_pose *offset, struct xrt_space_relation *out_relation)
Locate a space in the base space.
Definition: xrt_space.h:354
xrt_result_t(* create_local_space)(struct xrt_space_overseer *xso, struct xrt_space **out_local_space, struct xrt_space **out_local_floor_space)
Create a localspace and a localfloorspace.
Definition: xrt_space.h:302
static xrt_result_t xrt_space_overseer_create_offset_space(struct xrt_space_overseer *xso, struct xrt_space *parent, const struct xrt_pose *offset, struct xrt_space **out_space)
Create a space with a fixed offset to the parent space.
Definition: xrt_space.h:322
static xrt_result_t xrt_space_overseer_locate_device(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_device *xdev, struct xrt_space_relation *out_relation)
Locate a the origin of the tracking space of a device, this is not the same as the device position.
Definition: xrt_space.h:394
struct xrt_space * root
Root space, always available.
Definition: xrt_space.h:99
xrt_result_t(* locate_device)(struct xrt_space_overseer *xso, struct xrt_space *base_space, const struct xrt_pose *base_offset, int64_t at_timestamp_ns, struct xrt_device *xdev, struct xrt_space_relation *out_relation)
Locate a the origin of the tracking space of a device, this is not the same as the device position.
Definition: xrt_space.h:207
static xrt_result_t xrt_space_overseer_get_reference_space_offset(struct xrt_space_overseer *xso, enum xrt_reference_space_type type, struct xrt_pose *out_offset)
Read the offset from the given reference space, not all implementations of xrt_space_overseer may sup...
Definition: xrt_space.h:481
xrt_result_t(* create_pose_space)(struct xrt_space_overseer *xso, struct xrt_device *xdev, enum xrt_input_name name, struct xrt_space **out_space)
Create a space that wraps the xdev input pose described by input name, implicitly make the device's t...
Definition: xrt_space.h:142
static xrt_result_t xrt_space_overseer_set_tracking_origin_offset(struct xrt_space_overseer *xso, struct xrt_tracking_origin *xto, const struct xrt_pose *offset)
Apply an offset to a tracking origin, not all implementations of xrt_space_overseer may support this.
Definition: xrt_space.h:466
static xrt_result_t xrt_space_overseer_create_pose_space(struct xrt_space_overseer *xso, struct xrt_device *xdev, enum xrt_input_name name, struct xrt_space **out_space)
Create a space that wraps the xdev input pose described by input name, implicitly make the device's t...
Definition: xrt_space.h:338
xrt_result_t(* recenter_local_spaces)(struct xrt_space_overseer *xso)
Trigger a re-center of the local and local_floor spaces, not all implementations of xrt_space_oversee...
Definition: xrt_space.h:243
struct xrt_space * localfloorspace[128]
Ptrs to the localfloorspace.
Definition: xrt_space.h:114
xrt_result_t(* ref_space_inc)(struct xrt_space_overseer *xso, enum xrt_reference_space_type type)
Increment the usage count of a reference space (aka semantic space).
Definition: xrt_space.h:224
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:657
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition: xrt_space.h:31
struct xrt_reference reference
Reference helper.
Definition: xrt_space.h:35
void(* destroy)(struct xrt_space *xs)
Destroy function.
Definition: xrt_space.h:40
A tracking system or device origin.
Definition: xrt_tracking.h:71
Common defines and enums for XRT.