From b1e53da2bb016ccd7547105c30b5d71208da3c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Fri, 26 Jun 2026 14:23:15 +0200 Subject: [PATCH] fix(avlivebody): track hand face depth to pelvis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drive HandFaceSkeleton.setDepth() from the body pelvis z each frame (negated ARKit→RealityKit) so hand/face markers follow body depth instead of rendering at the fixed default plane depth 0. --- avlivebody-mac/Sources/AVLiveBody/AVLiveBodyApp.swift | 4 +++- avlivebody-mac/Sources/AVLiveBody/SceneController.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/avlivebody-mac/Sources/AVLiveBody/AVLiveBodyApp.swift b/avlivebody-mac/Sources/AVLiveBody/AVLiveBodyApp.swift index 285f815..e935525 100644 --- a/avlivebody-mac/Sources/AVLiveBody/AVLiveBodyApp.swift +++ b/avlivebody-mac/Sources/AVLiveBody/AVLiveBodyApp.swift @@ -105,7 +105,9 @@ struct ContentView: View { hands: consumer.hands, face: consumer.face, prevPelvis: &prevPelvis) - controller.updateHandFace(hands: consumer.hands, face: consumer.face) + controller.updateHandFace(hands: consumer.hands, + face: consumer.face, + depth: Float(-(prevPelvis?.z ?? 0))) } private func wire() { diff --git a/avlivebody-mac/Sources/AVLiveBody/SceneController.swift b/avlivebody-mac/Sources/AVLiveBody/SceneController.swift index 39a9de5..0d64f24 100644 --- a/avlivebody-mac/Sources/AVLiveBody/SceneController.swift +++ b/avlivebody-mac/Sources/AVLiveBody/SceneController.swift @@ -95,7 +95,9 @@ final class SceneController { mesh?.update(persons) } - func updateHandFace(hands: HandsPayload?, face: FacePayload?) { + func updateHandFace(hands: HandsPayload?, face: FacePayload?, + depth: Float) { + handFace?.setDepth(depth) handFace?.update(hands: hands, face: face) }