st/oxr+xrt: add is_active to struct xrt_hand_joint_set to give drivers an easy way to deactivate hands

This commit is contained in:
Moses Turner 2021-03-07 10:41:57 -06:00 committed by Christoph Haag
parent a027852767
commit 6a833b1131
2 changed files with 13 additions and 3 deletions

View file

@ -1,9 +1,10 @@
// Copyright 2019-2020, Collabora, Ltd. // Copyright 2019-2021, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
* @brief Common defines and enums for XRT. * @brief Common defines and enums for XRT.
* @author Jakob Bornecrantz <jakob@collabora.com> * @author Jakob Bornecrantz <jakob@collabora.com>
* @author Moses Turner <mosesturner@protonmail.com>
* @ingroup xrt_iface * @ingroup xrt_iface
*/ */
@ -754,6 +755,7 @@ struct xrt_hand_joint_set
// in driver global space, without tracking_origin offset // in driver global space, without tracking_origin offset
struct xrt_space_relation hand_pose; struct xrt_space_relation hand_pose;
bool is_active;
}; };
/*! /*!

View file

@ -1,9 +1,10 @@
// Copyright 2018-2020, Collabora, Ltd. // Copyright 2018-2021, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0 // SPDX-License-Identifier: BSL-1.0
/*! /*!
* @file * @file
* @brief Holds session related functions. * @brief Holds session related functions.
* @author Jakob Bornecrantz <jakob@collabora.com> * @author Jakob Bornecrantz <jakob@collabora.com>
* @author Moses Turner <mosesturner@protonmail.com>
* @ingroup oxr_main * @ingroup oxr_main
*/ */
@ -2260,7 +2261,14 @@ oxr_session_hand_joints(struct oxr_logger *log,
} }
} }
if (value.is_active) {
locations->isActive = true; locations->isActive = true;
} else {
locations->isActive = false;
for (uint32_t i = 0; i < locations->jointCount; i++) {
locations->jointLocations[i].locationFlags = XRT_SPACE_RELATION_BITMASK_NONE;
}
}
return XR_SUCCESS; return XR_SUCCESS;
} }