Corrigiu mapeamento de botões
X-Lovable-Edit-ID: edt-e1f43d22-5a46-430c-b85c-7dac2fefa933 Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -87,8 +87,9 @@ export function useControllerGrab() {
|
|||||||
const gp = source.gamepad;
|
const gp = source.gamepad;
|
||||||
|
|
||||||
if (gp) {
|
if (gp) {
|
||||||
const gripBtn = gp.buttons[2];
|
// xr-standard mapping: [0]=trigger, [1]=squeeze/grip, [2]=touchpad, [3]=thumbstick
|
||||||
const trigBtn = gp.buttons[1];
|
const trigBtn = gp.buttons[0];
|
||||||
|
const gripBtn = gp.buttons[1];
|
||||||
const gripValue = gripBtn ? (gripBtn.value || (gripBtn.pressed ? 1 : 0)) : 0;
|
const gripValue = gripBtn ? (gripBtn.value || (gripBtn.pressed ? 1 : 0)) : 0;
|
||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user