Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -168,12 +168,14 @@ export function XRHudInWorld(props: XRHudInWorldProps) {
|
||||
}
|
||||
|
||||
function FloatingPanel({
|
||||
tab, setTab, pinned, onTogglePin, onRecenter, ...p
|
||||
tab, setTab, pinned, onTogglePin, dragging, onToggleDrag, onRecenter, ...p
|
||||
}: {
|
||||
tab: Tab;
|
||||
setTab: (t: Tab) => void;
|
||||
pinned: boolean;
|
||||
onTogglePin: () => void;
|
||||
dragging: boolean;
|
||||
onToggleDrag: () => void;
|
||||
onRecenter: () => void;
|
||||
} & XRHudInWorldProps) {
|
||||
const tabs: { id: Tab; label: string; icon: string }[] = [
|
||||
@@ -190,13 +192,20 @@ function FloatingPanel({
|
||||
anchorX="left" anchorY="middle">
|
||||
TrackSteelXR · HUD AR
|
||||
</Text>
|
||||
{/* Pin / Recenter controls (replace the previous static "A button" hint) */}
|
||||
<group position={[W / 2 - 0.012, H / 2 - 0.018, 0.002]}>
|
||||
<XR3DButton position={[-0.045, 0, 0]} size={[0.05, 0.022]}
|
||||
{/* Pin / Drag / Recenter — anchored to top-right, kept inside the panel.
|
||||
Group origin is at the right edge with margin; buttons extend leftward. */}
|
||||
<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'}
|
||||
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 position={[0, H / 2 - 0.045, 0.001]}>
|
||||
|
||||
Reference in New Issue
Block a user