43XRT_CHECK_RESULT XrResult
64#define GET_STATIC_XDEV_BY_ROLE(SYS, ROLE) (get_static_role_##ROLE((SYS)))
74#define STATIC_WRAP(ROLE) \
75 static inline struct xrt_device *get_role_##ROLE(const struct oxr_roles *roles) \
77 return get_static_role_##ROLE(roles->sys); \
83STATIC_WRAP(hand_tracking_unobstructed_left)
84STATIC_WRAP(hand_tracking_unobstructed_right)
85STATIC_WRAP(hand_tracking_conforming_left)
86STATIC_WRAP(hand_tracking_conforming_right)
90#define MAKE_GET_DYN_ROLES_FN(ROLE) \
91 static inline struct xrt_device *get_role_##ROLE(const struct oxr_roles *roles) \
93 const int32_t xdev_idx = roles->roles.ROLE; \
94 struct xrt_system_devices *xsysd = roles->sys->xsysd; \
95 if (xdev_idx < 0 || xdev_idx >= (int32_t)xsysd->xdev_count) { \
98 return xsysd->xdevs[xdev_idx]; \
100MAKE_GET_DYN_ROLES_FN(left)
101MAKE_GET_DYN_ROLES_FN(right)
102MAKE_GET_DYN_ROLES_FN(gamepad)
103#undef MAKE_GET_DYN_ROLES_FN
105#define GET_XDEV_BY_ROLE(ROLES, ROLE) (get_role_##ROLE((ROLES)))
115get_role_profile_head(
const struct oxr_roles *roles)
117 return XRT_DEVICE_INVALID;
120get_role_profile_eyes(
const struct oxr_roles *roles)
122 return XRT_DEVICE_INVALID;
125get_role_profile_face(
const struct oxr_roles *roles)
127 return XRT_DEVICE_INVALID;
130get_role_profile_body(
const struct oxr_roles *roles)
132 return XRT_DEVICE_INVALID;
135get_role_profile_hand_tracking_unobstructed_left(
const struct oxr_roles *roles)
137 return XRT_DEVICE_INVALID;
140get_role_profile_hand_tracking_unobstructed_right(
const struct oxr_roles *roles)
142 return XRT_DEVICE_INVALID;
146get_role_profile_hand_tracking_conforming_left(
const struct oxr_roles *roles)
148 return XRT_DEVICE_INVALID;
151get_role_profile_hand_tracking_conforming_right(
const struct oxr_roles *roles)
153 return XRT_DEVICE_INVALID;
156#define MAKE_GET_DYN_ROLE_PROFILE_FN(ROLE) \
157 static inline enum xrt_device_name get_role_profile_##ROLE(const struct oxr_roles *roles) \
159 return roles->roles.ROLE##_profile; \
161MAKE_GET_DYN_ROLE_PROFILE_FN(left)
162MAKE_GET_DYN_ROLE_PROFILE_FN(right)
163MAKE_GET_DYN_ROLE_PROFILE_FN(gamepad)
164#undef MAKE_GET_DYN_ROLES_FN
166#define GET_PROFILE_NAME_BY_ROLE(ROLES, ROLE) (get_role_profile_##ROLE((ROLES)))
XRT_CHECK_RESULT XrResult oxr_roles_init_on_stack(struct oxr_logger *log, struct oxr_roles *roles, struct oxr_system *sys)
Initialize an oxr_roles struct on the stack.
Definition: oxr_roles.c:15
The objects representing OpenXR handles, and prototypes for internal functions used in the state trac...
Logger struct that lives on the stack, one for each call client call.
Definition: oxr_logger.h:40
Helper struct that wraps xrt_system_roles for OpenXR state tracker usage.
Definition: oxr_roles.h:30
struct xrt_system_roles roles
The roles of the devices that the session is using.
Definition: oxr_roles.h:35
struct oxr_system * sys
To access the xrt_system_devices struct.
Definition: oxr_roles.h:32
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition: oxr_objects.h:1524
struct xrt_system_devices * xsysd
System devices used in all session types.
Definition: oxr_objects.h:1531
A single HMD or input device.
Definition: xrt_device.h:310
struct xrt_system_devices::@265::@266 hand_tracking
Devices providing optical (or otherwise more directly measured than from controller estimation) hand ...
struct xrt_system_devices::@265 static_roles
Observing pointers for devices in some static (unchangeable) roles.
struct xrt_device * head
An observing pointer to the device serving as the "head" (and HMD).
Definition: xrt_system.h:243
struct xrt_device * face
An observing pointer to the device providing face tracking (optional).
Definition: xrt_system.h:255
struct xrt_device * eyes
An observing pointer to the device providing eye tracking (optional).
Definition: xrt_system.h:249
struct xrt_device * left
An observing pointer to the device providing unobstructed hand-tracking for the left hand (optional).
Definition: xrt_system.h:278
struct xrt_device * right
An observing pointer to the device providing unobstructed hand-tracking for the right hand (optional)...
Definition: xrt_system.h:287
struct xrt_device * body
An observing pointer to the device providing body tracking (optional).
Definition: xrt_system.h:261
Data associating a device index (in xrt_system_devices::xdevs) with a given "role" for dynamic role s...
Definition: xrt_system.h:154
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:724