The open source OpenXR runtime
0
fork

Configure Feed

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

u/device: Add u_device_get_view_poses helper

+33
+20
src/xrt/auxiliary/util/u_device.c
··· 444 444 445 445 *out_pose = pose; 446 446 } 447 + 448 + void 449 + u_device_get_view_poses(struct xrt_device *xdev, 450 + const struct xrt_vec3 *default_eye_relation, 451 + uint64_t at_timestamp_ns, 452 + uint32_t view_count, 453 + struct xrt_space_relation *out_head_relation, 454 + struct xrt_fov *out_fovs, 455 + struct xrt_pose *out_poses) 456 + { 457 + xrt_device_get_tracked_pose(xdev, XRT_INPUT_GENERIC_HEAD_POSE, at_timestamp_ns, out_head_relation); 458 + 459 + for (uint32_t i = 0; i < view_count && i < ARRAY_SIZE(xdev->hmd->views); i++) { 460 + out_fovs[i] = xdev->hmd->views[i].fov; 461 + } 462 + 463 + for (uint32_t i = 0; i < view_count; i++) { 464 + u_device_get_view_pose(default_eye_relation, i, &out_poses[i]); 465 + } 466 + }
+13
src/xrt/auxiliary/util/u_device.h
··· 158 158 void 159 159 u_device_get_view_pose(const struct xrt_vec3 *eye_relation, uint32_t view_index, struct xrt_pose *out_pose); 160 160 161 + /*! 162 + * Helper function for `get_view_poses` in a HMD driver. 163 + */ 164 + void 165 + u_device_get_view_poses(struct xrt_device *xdev, 166 + const struct xrt_vec3 *default_eye_relation, 167 + uint64_t at_timestamp_ns, 168 + uint32_t view_count, 169 + struct xrt_space_relation *out_head_relation, 170 + struct xrt_fov *out_fovs, 171 + struct xrt_pose *out_poses); 172 + 173 + 161 174 #ifdef __cplusplus 162 175 } 163 176 #endif