st/oxr: Fix running when only one hand suports hand tracking

This commit is contained in:
Christoph Haag 2021-04-08 20:32:55 +02:00
parent 08e39a1a0e
commit e7f82c297a
2 changed files with 8 additions and 2 deletions

View file

@ -298,11 +298,12 @@ oxr_hand_tracker_create(struct oxr_logger *log,
hand_tracker->hand = createInfo->hand;
hand_tracker->hand_joint_set = createInfo->handJointSet;
//! @todo: Implement choice when more than one device has hand tracking
//! @todo: move hand tracking device selection to oxr_system.
// if no xdev with hand tracking is found, create hand tracker without xdev.
for (uint32_t i = 0; i < sess->sys->num_xdevs; i++) {
struct xrt_device *xdev = sess->sys->xdevs[i];
if (!xdev->hand_tracking_supported) {
if (!xdev || !xdev->hand_tracking_supported) {
continue;
}

View file

@ -2155,6 +2155,11 @@ oxr_session_hand_joints(struct oxr_logger *log,
XrHandJointVelocitiesEXT *vel =
OXR_GET_OUTPUT_FROM_CHAIN(locations, XR_TYPE_HAND_JOINT_VELOCITIES_EXT, XrHandJointVelocitiesEXT);
if (hand_tracker->xdev == NULL) {
locations->isActive = false;
return XR_SUCCESS;
}
struct xrt_device *xdev = hand_tracker->xdev;
enum xrt_input_name name = hand_tracker->input_name;