mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
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:
parent
a027852767
commit
6a833b1131
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2019-2020, Collabora, Ltd.
|
||||
// Copyright 2019-2021, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
* @brief Common defines and enums for XRT.
|
||||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
||||
* @author Moses Turner <mosesturner@protonmail.com>
|
||||
* @ingroup xrt_iface
|
||||
*/
|
||||
|
||||
|
@ -754,6 +755,7 @@ struct xrt_hand_joint_set
|
|||
|
||||
// in driver global space, without tracking_origin offset
|
||||
struct xrt_space_relation hand_pose;
|
||||
bool is_active;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2018-2020, Collabora, Ltd.
|
||||
// Copyright 2018-2021, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
* @brief Holds session related functions.
|
||||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
||||
* @author Moses Turner <mosesturner@protonmail.com>
|
||||
* @ingroup oxr_main
|
||||
*/
|
||||
|
||||
|
@ -2260,7 +2261,14 @@ oxr_session_hand_joints(struct oxr_logger *log,
|
|||
}
|
||||
}
|
||||
|
||||
locations->isActive = true;
|
||||
if (value.is_active) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue