From 002682e6f31cfec739156d6e398f3e452fe7c02b Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Tue, 2 Jun 2026 21:35:17 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20melhoria=20no=20s?= =?UTF-8?q?nap=20e=20medi=C3=A7=C3=A3o=20AR=20em=2002/06/2026=2021:35:17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/three/ControllerLocomotion.tsx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/components/three/ControllerLocomotion.tsx b/src/components/three/ControllerLocomotion.tsx index 40e29ff..7855fd1 100644 --- a/src/components/three/ControllerLocomotion.tsx +++ b/src/components/three/ControllerLocomotion.tsx @@ -30,9 +30,19 @@ export function ControllerLocomotion({ rigRef }: Props) { const fwdPushed = useRef(false); const raycaster = useRef(new THREE.Raycaster()); + const [arcLine] = useState(() => { + const geom = new THREE.BufferGeometry(); + const mat = new THREE.LineBasicMaterial({ + color: '#06b6d4', + transparent: true, + opacity: 0.8, + }); + const line = new THREE.Line(geom, mat); + line.visible = false; + return line; + }); + // Refs visuais - const arcLineRef = useRef(null); - const lineGeomRef = useRef(null); const reticleRef = useRef(null); // Estados temporários do teletransporte @@ -42,7 +52,7 @@ export function ControllerLocomotion({ rigRef }: Props) { useFrame((_state, _dt, frame: XRFrame | undefined) => { const rig = rigRef.current; if (!rig || !session || !frame) { - if (arcLineRef.current) arcLineRef.current.visible = false; + arcLine.visible = false; if (reticleRef.current) reticleRef.current.visible = false; return; } @@ -146,12 +156,10 @@ export function ControllerLocomotion({ rigRef }: Props) { lastTeleportHitModel.current = hitModel; // Atualiza a geometria do arco - if (lineGeomRef.current && arcLineRef.current) { - lineGeomRef.current.setFromPoints(points); - lineGeomRef.current.attributes.position.needsUpdate = true; - lineGeomRef.current.computeBoundingSphere(); - arcLineRef.current.visible = true; - } + arcLine.geometry.setFromPoints(points); + arcLine.geometry.attributes.position.needsUpdate = true; + arcLine.geometry.computeBoundingSphere(); + arcLine.visible = true; // Atualiza o retículo if (reticleRef.current) { @@ -200,7 +208,7 @@ export function ControllerLocomotion({ rigRef }: Props) { } // Oculta feixe e retículo - if (arcLineRef.current) arcLineRef.current.visible = false; + arcLine.visible = false; if (reticleRef.current) reticleRef.current.visible = false; } }); @@ -208,10 +216,7 @@ export function ControllerLocomotion({ rigRef }: Props) { return ( <> {/* Arco parabólico premium */} - - - - + {/* Retículo de pouso */}