diff --git a/src/components/three/XRGrabbable.tsx b/src/components/three/XRGrabbable.tsx index e72cf7a..03ace6e 100644 --- a/src/components/three/XRGrabbable.tsx +++ b/src/components/three/XRGrabbable.tsx @@ -47,7 +47,7 @@ const _tmpQuat = new THREE.Quaternion(); * On release the group keeps its last pose (we don't write to the store — * the manual fine-tuning sliders remain available as additional offsets). */ -export function XRGrabbable({ allowScale = false, onGrabStart, children }: XRGrabbableProps) { +export function XRGrabbable({ allowScale = false, lockedActive = false, onGrabStart, children }: XRGrabbableProps) { const groupRef = useRef(null); const grab = useControllerGrab(); @@ -63,6 +63,14 @@ export function XRGrabbable({ allowScale = false, onGrabStart, children }: XRGra const L = snap.left; const R = snap.right; + // Locked: ignore all grab input — release any in-progress grabs and bail. + if (lockedActive) { + if (single.current) single.current = null; + if (dual.current) dual.current = null; + if (haloRef.current) haloRef.current.visible = false; + return; + } + const lActive = L.isGrabbing && L.hasPose; const rActive = R.isGrabbing && R.hasPose;