mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 04:36:07 +00:00
u/device: Assign left/right hand trackers if no controllers are available
Previously the left/right role assignment considered only device types * XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER * XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER * XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER This adds XRT_DEVICE_TYPE_HAND_TRACKER for consideration, but only if none of the above are present.
This commit is contained in:
parent
057f65630f
commit
7831e38c02
|
@ -350,6 +350,22 @@ u_device_assign_xdev_roles(struct xrt_device **xdevs,
|
|||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
// fill unassigned left/right with hand trackers if available
|
||||
for (size_t i = 0; i < num_xdevs; i++) {
|
||||
if (xdevs[i] == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (xdevs[i]->device_type == XRT_DEVICE_TYPE_HAND_TRACKER) {
|
||||
if (*left == XRT_DEVICE_ROLE_UNASSIGNED) {
|
||||
*left = i;
|
||||
}
|
||||
if (*right == XRT_DEVICE_ROLE_UNASSIGNED) {
|
||||
*right = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue