Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-09-30 01:36:51 +03:00
parent e8ee25cd88
commit 9b00e30b97
4 changed files with 128 additions and 38 deletions

View File

@@ -159,6 +159,9 @@ bool LunarWM_init(LunarWM *wm)
wm->xr.local_space = wm->xr.view_space = XR_NULL_HANDLE;
wm->xr.hand_tracking_system_properties.type
= XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT;
wm->xr.hand_tracking_system_properties.next = NULL;
wm->xr.hand_tracking_system_properties.supportsHandTracking = XR_FALSE;
wm->xr.hand_tracking_enabled = false;
wm->renderer.camera.position = (Vector3) { 0, 0, 0 };
wm->renderer.camera.target = (Vector3) { 0, 0, 1 };
wm->renderer.camera.up = (Vector3) { 0, 1, 0 };
@@ -340,10 +343,14 @@ void LunarWM_run(LunarWM *wm)
return;
}
if (wm->xr.hand_tracking_system_properties.supportsHandTracking) {
if (wm->xr.hand_tracking_enabled) {
for (size_t i = 0; i < 2; i++) {
LunarWM_Hand *hand = &wm->xr.hands[i];
bool const unobstructed = true;
if (!wm->xr.LocateHandJointsEXT
|| hand->hand_tracker == XR_NULL_HANDLE) {
continue;
}
XrHandJointsMotionRangeInfoEXT mri = {
.type = XR_TYPE_HAND_JOINTS_MOTION_RANGE_INFO_EXT,