Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -53,6 +53,8 @@ export function useControllerGrab() {
|
|||||||
const { gl } = useThree();
|
const { gl } = useThree();
|
||||||
|
|
||||||
useFrame((_state, _delta, frame: XRFrame | undefined) => {
|
useFrame((_state, _delta, frame: XRFrame | undefined) => {
|
||||||
|
const locked = useModelStore.getState().isLocked;
|
||||||
|
|
||||||
// DEVKIT: fake-input branch — bypasses real WebXR when SimXR is active.
|
// DEVKIT: fake-input branch — bypasses real WebXR when SimXR is active.
|
||||||
if (isFakeActive()) {
|
if (isFakeActive()) {
|
||||||
for (const hand of ['left', 'right'] as const) {
|
for (const hand of ['left', 'right'] as const) {
|
||||||
@@ -62,6 +64,13 @@ export function useControllerGrab() {
|
|||||||
slot.triggerValue = fake.triggerValue;
|
slot.triggerValue = fake.triggerValue;
|
||||||
slot.hasPose = fake.hasPose;
|
slot.hasPose = fake.hasPose;
|
||||||
slot.gripWorld.copy(fake.gripWorld);
|
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) {
|
if (!slot.isGrabbing && fake.gripValue > GRAB_ON) {
|
||||||
slot.isGrabbing = true;
|
slot.isGrabbing = true;
|
||||||
console.log(`[XR][grab] ▶ ${hand} START (fake v=${fake.gripValue.toFixed(2)})`);
|
console.log(`[XR][grab] ▶ ${hand} START (fake v=${fake.gripValue.toFixed(2)})`);
|
||||||
|
|||||||
Reference in New Issue
Block a user