Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-12 12:05:07 +00:00
parent e872ebdcb9
commit 8b70c9c474
+6 -2
View File
@@ -103,8 +103,12 @@ export function useControllerGrab() {
const trigValue = trigBtn ? (trigBtn.value || (trigBtn.pressed ? 1 : 0)) : 0;
slot.gripValue = gripValue;
slot.triggerValue = trigValue;
// Hysteresis
if (!slot.isGrabbing && gripValue > GRAB_ON) {
if (locked) {
if (slot.isGrabbing) {
slot.isGrabbing = false;
console.log(`[XR][grab] ◼ ${source.handedness} END (locked)`);
}
} else 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) {