Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -103,8 +103,12 @@ export function useControllerGrab() {
|
|||||||
const trigValue = trigBtn ? (trigBtn.value || (trigBtn.pressed ? 1 : 0)) : 0;
|
const trigValue = trigBtn ? (trigBtn.value || (trigBtn.pressed ? 1 : 0)) : 0;
|
||||||
slot.gripValue = gripValue;
|
slot.gripValue = gripValue;
|
||||||
slot.triggerValue = trigValue;
|
slot.triggerValue = trigValue;
|
||||||
// Hysteresis
|
if (locked) {
|
||||||
if (!slot.isGrabbing && gripValue > GRAB_ON) {
|
if (slot.isGrabbing) {
|
||||||
|
slot.isGrabbing = false;
|
||||||
|
console.log(`[XR][grab] ◼ ${source.handedness} END (locked)`);
|
||||||
|
}
|
||||||
|
} else if (!slot.isGrabbing && gripValue > GRAB_ON) {
|
||||||
slot.isGrabbing = true;
|
slot.isGrabbing = true;
|
||||||
console.log(`[XR][grab] ▶ ${source.handedness} START (v=${gripValue.toFixed(2)})`);
|
console.log(`[XR][grab] ▶ ${source.handedness} START (v=${gripValue.toFixed(2)})`);
|
||||||
} else if (slot.isGrabbing && gripValue < GRAB_OFF) {
|
} else if (slot.isGrabbing && gripValue < GRAB_OFF) {
|
||||||
|
|||||||
Reference in New Issue
Block a user