19#define XRT_MAX_CLIENT_SPACES 128
164 int64_t at_timestamp_ns,
186 int64_t at_timestamp_ns,
188 uint32_t space_count,
211 int64_t at_timestamp_ns,
305 struct xrt_space **out_local_floor_space);
411 int64_t at_timestamp_ns,
416 return xso->
locate_space(xso, base_space, base_offset, at_timestamp_ns, space, offset, out_relation);
430 int64_t at_timestamp_ns,
432 uint32_t space_count,
436 return xso->
locate_spaces(xso, base_space, base_offset, at_timestamp_ns, spaces, space_count, offsets,
451 int64_t at_timestamp_ns,
455 return xso->
locate_device(xso, base_space, base_offset, at_timestamp_ns, xdev, out_relation);
567 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:2410
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1359
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:2366
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:612
static void xrt_space_reference(struct xrt_space **dst, struct xrt_space *src)
Update the reference counts on space(s).
Definition: xrt_space.h:56
A single HMD or input device.
Definition: xrt_device.h:309
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:311
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
A base class for reference counted objects.
Definition: xrt_defines.h:99
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:97
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:505
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:280
struct xrt_space * unbounded
Unbounded space, only here for slam trackers.
Definition: xrt_space.h:105
struct xrt_space * localspace[128]
Ptrs to the localspace.
Definition: xrt_space.h:113
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:255
void(* destroy)(struct xrt_space_overseer *xs)
Destroy function.
Definition: xrt_space.h:365
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:234
struct xrt_space * local
Local space, may be null (in very rare cases).
Definition: xrt_space.h:102
struct xrt_space * local_floor
Local floor space, may be null.
Definition: xrt_space.h:103
static xrt_result_t xrt_space_overseer_add_device(struct xrt_space_overseer *xso, struct xrt_device *xdev)
Add a new device to be tracked by the space overseer.
Definition: xrt_space.h:580
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:479
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:125
struct xrt_space * view
View space, may be null (in very rare cases).
Definition: xrt_space.h:101
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:183
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:550
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:267
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:427
struct xrt_space * stage
Stage space, may be null.
Definition: xrt_space.h:104
static xrt_result_t xrt_space_overseer_attach_device(struct xrt_space_overseer *xso, struct xrt_device *xdev, struct xrt_space *space)
Attach a device to a different space then it was associated with originally, the space overseer might...
Definition: xrt_space.h:593
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:606
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:466
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:161
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:292
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:492
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:565
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:408
xrt_result_t(* add_device)(struct xrt_space_overseer *xso, struct xrt_device *xdev)
Add a new device to be tracked by the space overseer.
Definition: xrt_space.h:331
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:303
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:376
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:448
struct xrt_space * root
Root space, always available.
Definition: xrt_space.h:100
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:208
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:535
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:143
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:520
xrt_result_t(* attach_device)(struct xrt_space_overseer *xso, struct xrt_device *xdev, struct xrt_space *space)
Attach a device to a different space then it was associated with originally, the space overseer might...
Definition: xrt_space.h:351
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:392
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:244
struct xrt_space * localfloorspace[128]
Ptrs to the localfloorspace.
Definition: xrt_space.h:115
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:225
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
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:32
struct xrt_reference reference
Reference helper.
Definition: xrt_space.h:36
void(* destroy)(struct xrt_space *xs)
Destroy function.
Definition: xrt_space.h:41
A tracking system or device origin.
Definition: xrt_tracking.h:75
Common defines and enums for XRT.