Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -47,7 +47,7 @@ const _tmpQuat = new THREE.Quaternion();
|
|||||||
* On release the group keeps its last pose (we don't write to the store —
|
* 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).
|
* 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<THREE.Group>(null);
|
const groupRef = useRef<THREE.Group>(null);
|
||||||
const grab = useControllerGrab();
|
const grab = useControllerGrab();
|
||||||
|
|
||||||
@@ -63,6 +63,14 @@ export function XRGrabbable({ allowScale = false, onGrabStart, children }: XRGra
|
|||||||
const L = snap.left;
|
const L = snap.left;
|
||||||
const R = snap.right;
|
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 lActive = L.isGrabbing && L.hasPose;
|
||||||
const rActive = R.isGrabbing && R.hasPose;
|
const rActive = R.isGrabbing && R.hasPose;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user