From e872ebdcb98a913596000d941dd292c5f6154c84 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 12:04:54 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/hooks/useControllerGrab.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hooks/useControllerGrab.ts b/src/hooks/useControllerGrab.ts index 0a331f8..a2526ee 100644 --- a/src/hooks/useControllerGrab.ts +++ b/src/hooks/useControllerGrab.ts @@ -53,6 +53,8 @@ export function useControllerGrab() { const { gl } = useThree(); useFrame((_state, _delta, frame: XRFrame | undefined) => { + const locked = useModelStore.getState().isLocked; + // DEVKIT: fake-input branch — bypasses real WebXR when SimXR is active. if (isFakeActive()) { for (const hand of ['left', 'right'] as const) { @@ -62,6 +64,13 @@ export function useControllerGrab() { slot.triggerValue = fake.triggerValue; slot.hasPose = fake.hasPose; slot.gripWorld.copy(fake.gripWorld); + if (locked) { + if (slot.isGrabbing) { + slot.isGrabbing = false; + console.log(`[XR][grab] ◼ ${hand} END (locked)`); + } + continue; + } if (!slot.isGrabbing && fake.gripValue > GRAB_ON) { slot.isGrabbing = true; console.log(`[XR][grab] ▶ ${hand} START (fake v=${fake.gripValue.toFixed(2)})`);