Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-12 12:04:54 +00:00
parent 5a930144db
commit e872ebdcb9
+9
View File
@@ -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)})`);