Reverted to commit ceb9b8c1a1

This commit is contained in:
gpt-engineer-app[bot]
2026-05-13 21:12:16 +00:00
parent 96e806042f
commit fe2d6a3ae0
16 changed files with 128 additions and 931 deletions
+2 -16
View File
@@ -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) {