🚀 Auto-deploy: melhoria no snap e medição AR em 24/05/2026 18:16:19

This commit is contained in:
2026-05-24 18:16:19 +00:00
parent f01c0f6d01
commit ee6318859e
@@ -130,14 +130,27 @@ export function DesktopFirstPersonControls() {
camera.rotation.x = Math.max(-1.4, Math.min(1.4, camera.rotation.x)); camera.rotation.x = Math.max(-1.4, Math.min(1.4, camera.rotation.x));
} }
// Gatilhos para controle de altura (RT sobe, LT desce) // Suporta tanto o mapeamento de Triggers (RT/LT - botões 7/6) quanto de Grips/Bumpers (RB/LB - botões 5/4) para subir e descer a altura da câmera
const triggerLT = gp.buttons[6]; const triggerLT = gp.buttons[6];
const triggerRT = gp.buttons[7]; const triggerRT = gp.buttons[7];
if (triggerRT && triggerRT.value > 0.1) { const bumperLB = gp.buttons[4];
camera.position.y += triggerRT.value * speed; const bumperRB = gp.buttons[5];
const valUp = Math.max(
triggerRT ? (triggerRT.value || (triggerRT.pressed ? 1 : 0)) : 0,
bumperRB ? (bumperRB.value || (bumperRB.pressed ? 1 : 0)) : 0
);
const valDown = Math.max(
triggerLT ? (triggerLT.value || (triggerLT.pressed ? 1 : 0)) : 0,
bumperLB ? (bumperLB.value || (bumperLB.pressed ? 1 : 0)) : 0
);
if (valUp > 0.1) {
camera.position.y += valUp * speed;
} }
if (triggerLT && triggerLT.value > 0.1) { if (valDown > 0.1) {
camera.position.y -= triggerLT.value * speed; camera.position.y -= valDown * speed;
} }
} }