Reverted to commit ceb9b8c1a1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { useRef } from 'react';
|
||||
import { useFrame, useThree } from '@react-three/fiber';
|
||||
import * as THREE from 'three';
|
||||
import { useModelStore } from '@/stores/useModelStore';
|
||||
// DEVKIT: remove this import + the fake-input block in useFrame to strip devkit
|
||||
import { fakeInput, isFakeActive } from '@/devkit/fakeInputStore';
|
||||
|
||||
@@ -53,8 +52,6 @@ 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) {
|
||||
@@ -64,13 +61,6 @@ 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)})`);
|
||||
@@ -103,12 +93,8 @@ export function useControllerGrab() {
|
||||
const trigValue = trigBtn ? (trigBtn.value || (trigBtn.pressed ? 1 : 0)) : 0;
|
||||
slot.gripValue = gripValue;
|
||||
slot.triggerValue = trigValue;
|
||||
if (locked) {
|
||||
if (slot.isGrabbing) {
|
||||
slot.isGrabbing = false;
|
||||
console.log(`[XR][grab] ◼ ${source.handedness} END (locked)`);
|
||||
}
|
||||
} else if (!slot.isGrabbing && gripValue > GRAB_ON) {
|
||||
// Hysteresis
|
||||
if (!slot.isGrabbing && gripValue > GRAB_ON) {
|
||||
slot.isGrabbing = true;
|
||||
console.log(`[XR][grab] ▶ ${source.handedness} START (v=${gripValue.toFixed(2)})`);
|
||||
} else if (slot.isGrabbing && gripValue < GRAB_OFF) {
|
||||
|
||||
Reference in New Issue
Block a user