Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-15 11:45:20 +00:00
parent a97904bf2a
commit 9c435cc694
+15 -6
View File
@@ -168,12 +168,14 @@ export function XRHudInWorld(props: XRHudInWorldProps) {
} }
function FloatingPanel({ function FloatingPanel({
tab, setTab, pinned, onTogglePin, onRecenter, ...p tab, setTab, pinned, onTogglePin, dragging, onToggleDrag, onRecenter, ...p
}: { }: {
tab: Tab; tab: Tab;
setTab: (t: Tab) => void; setTab: (t: Tab) => void;
pinned: boolean; pinned: boolean;
onTogglePin: () => void; onTogglePin: () => void;
dragging: boolean;
onToggleDrag: () => void;
onRecenter: () => void; onRecenter: () => void;
} & XRHudInWorldProps) { } & XRHudInWorldProps) {
const tabs: { id: Tab; label: string; icon: string }[] = [ const tabs: { id: Tab; label: string; icon: string }[] = [
@@ -190,13 +192,20 @@ function FloatingPanel({
anchorX="left" anchorY="middle"> anchorX="left" anchorY="middle">
TrackSteelXR · HUD AR TrackSteelXR · HUD AR
</Text> </Text>
{/* Pin / Recenter controls (replace the previous static "A button" hint) */} {/* Pin / Drag / Recenter — anchored to top-right, kept inside the panel.
<group position={[W / 2 - 0.012, H / 2 - 0.018, 0.002]}> Group origin is at the right edge with margin; buttons extend leftward. */}
<XR3DButton position={[-0.045, 0, 0]} size={[0.05, 0.022]} <group position={[W / 2 - 0.008, H / 2 - 0.018, 0.002]}>
{/* Trazer (recenter) — rightmost, half-width 0.029 from origin */}
<XR3DButton position={[-0.029, 0, 0]} size={[0.054, 0.022]}
label="⎚ Trazer" onClick={onRecenter} fontSize={0.007} />
{/* Mover (drag with right controller) */}
<XR3DButton position={[-0.088, 0, 0]} size={[0.054, 0.022]}
label={dragging ? '✋ Solte' : '✋ Mover'}
active={dragging} onClick={onToggleDrag} fontSize={0.007} />
{/* Pin */}
<XR3DButton position={[-0.144, 0, 0]} size={[0.054, 0.022]}
label={pinned ? '📌 Fixo' : '↻ Solto'} label={pinned ? '📌 Fixo' : '↻ Solto'}
active={pinned} onClick={onTogglePin} fontSize={0.007} /> active={pinned} onClick={onTogglePin} fontSize={0.007} />
<XR3DButton position={[0.012, 0, 0]} size={[0.058, 0.022]}
label="⎚ Trazer" onClick={onRecenter} fontSize={0.007} />
</group> </group>
<group position={[0, H / 2 - 0.045, 0.001]}> <group position={[0, H / 2 - 0.045, 0.001]}>