The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: adds more oxr to xr conversions

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2604>

+55
+55
src/xrt/state_trackers/oxr/oxr_conversions.h
··· 289 289 default: assert(false); return XR_HAND_TRACKING_DATA_SOURCE_MAX_ENUM_EXT; 290 290 } 291 291 } 292 + 293 + 294 + /* 295 + * 296 + * Basic types 297 + * 298 + */ 299 + 300 + static inline XrExtent2Di 301 + xrt_size_to_xr(const struct xrt_size *x) 302 + { 303 + return (XrExtent2Di){ 304 + .width = x->w, 305 + .height = x->h, 306 + }; 307 + } 308 + 309 + static inline XrVector2f 310 + xrt_vec2_to_xr(const struct xrt_vec2 *v) 311 + { 312 + return (XrVector2f){ 313 + .x = v->x, 314 + .y = v->y, 315 + }; 316 + } 317 + 318 + static inline XrVector3f 319 + xrt_vec3_to_xr(const struct xrt_vec3 *v) 320 + { 321 + return (XrVector3f){ 322 + .x = v->x, 323 + .y = v->y, 324 + .z = v->z, 325 + }; 326 + } 327 + 328 + static inline XrQuaternionf 329 + xrt_quat_to_xr(const struct xrt_quat *q) 330 + { 331 + return (XrQuaternionf){ 332 + .x = q->x, 333 + .y = q->y, 334 + .z = q->z, 335 + .w = q->w, 336 + }; 337 + } 338 + 339 + static inline XrPosef 340 + xrt_pose_to_xr(const struct xrt_pose *q) 341 + { 342 + return (XrPosef){ 343 + .orientation = xrt_quat_to_xr(&q->orientation), 344 + .position = xrt_vec3_to_xr(&q->position), 345 + }; 346 + }