From f51656cf0e413e79ddc5de0eddb4a65858ce9ef6 Mon Sep 17 00:00:00 2001 From: kinect-bot Date: Thu, 26 Nov 2026 22:32:13 -0500 Subject: [PATCH] diag(windows-nui): comprehensive paired log - all candidate hand/ref joints + both cursor slots + state flag (one sweep captures everything) --- fallback/windows-nui/src/sensor.cpp | 46 ++++++++++++++++------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/fallback/windows-nui/src/sensor.cpp b/fallback/windows-nui/src/sensor.cpp index 8589dee..4f4801c 100644 --- a/fallback/windows-nui/src/sensor.cpp +++ b/fallback/windows-nui/src/sensor.cpp @@ -761,33 +761,39 @@ void VirtualKinectSensor::BuildSkeletonFrame(const SourceFrame& src) { static unsigned hand_calls = 0; if ((hand_calls++ % 15u) == 0u) { const NUI_SKELETON_DATA& d0 = frame.SkeletonData[0]; - const Vector4& hr = d0.SkeletonPositions[11]; // HAND_R - const Vector4& sc = d0.SkeletonPositions[2]; // SHOULDER_CENTER - const Vector4& sr = d0.SkeletonPositions[8]; // SHOULDER_R - // Read the game's live cursor at the SAME instant as the hand, so the pair - // is correlated (2s-apart sampling before was too coarse to solve). - float cx = -1.0f, cy = -1.0f; + auto& P = d0.SkeletonPositions; + // Read the game's live cursor + state at the SAME instant as the joints so + // every pair is correlated. Log ALL candidate hand/reference joints and both + // cursor slots so one sweep pins which joints the game's mapping uses. + float cx = -1, cy = -1, c2x = -1, c2y = -1; + uint32_t flag = 0xFF; HMODULE gk = GetModuleHandleA("gamekdm.dll"); if (gk != nullptr) { uint32_t obj = 0; SafeReadU32(reinterpret_cast(gk) + 0x3d2bb8u, &obj); - if (obj != 0) { - uint32_t inner = 0; - SafeReadU32(obj, &inner); - if (inner != 0) { - uint32_t ux = 0, uy = 0; - SafeReadU32(inner + 0x108u, &ux); - SafeReadU32(inner + 0x10cu, &uy); - std::memcpy(&cx, &ux, sizeof(cx)); - std::memcpy(&cy, &uy, sizeof(cy)); - } + uint32_t inner = 0; + if (obj != 0) SafeReadU32(obj, &inner); + if (inner != 0) { + uint32_t a = 0, b = 0, cc = 0, dd = 0; + SafeReadU32(inner + 0x108u, &a); + SafeReadU32(inner + 0x10cu, &b); + SafeReadU32(inner + 0x110u, &cc); + SafeReadU32(inner + 0x114u, &dd); + SafeReadU32(inner + 0xfcu, &flag); + std::memcpy(&cx, &a, 4); + std::memcpy(&cy, &b, 4); + std::memcpy(&c2x, &cc, 4); + std::memcpy(&c2y, &dd, 4); } } ShimLog( - "handcur: HAND_R=(%.2f,%.2f,%.2f) SH_C=(%.2f,%.2f) relSHC=(%.2f,%.2f) " - "relSHR=(%.2f,%.2f) CURSOR=(%.0f,%.0f)", - hr.x, hr.y, hr.z, sc.x, sc.y, hr.x - sc.x, hr.y - sc.y, hr.x - sr.x, - hr.y - sr.y, cx, cy); + "handcur: HR=(%.2f,%.2f,%.2f) HL=(%.2f,%.2f) ELR=(%.2f,%.2f) " + "WRR=(%.2f,%.2f) HEAD=(%.2f,%.2f) HIP=(%.2f,%.2f) SPINE=(%.2f,%.2f) " + "SHC=(%.2f,%.2f) SHL=(%.2f,%.2f) SHR=(%.2f,%.2f) | CUR1=(%.0f,%.0f) " + "CUR2=(%.0f,%.0f) flag=0x%X", + P[11].x, P[11].y, P[11].z, P[7].x, P[7].y, P[9].x, P[9].y, P[10].x, + P[10].y, P[3].x, P[3].y, P[0].x, P[0].y, P[1].x, P[1].y, P[2].x, P[2].y, + P[4].x, P[4].y, P[8].x, P[8].y, cx, cy, c2x, c2y, flag & 0xFFu); } latest_skeleton_ = frame;