# Scout walker

A two-legged reconnaissance walker whose cab is a mass above its hips: with one foot down the support is that foot, so it rolls the whole machine over the leg that is staying put.

> For the complete index, see [llms.txt](https://robocn.dev/llms.txt). A Markdown version of any page is available by appending `.md` to its URL or by sending an `Accept: text/markdown` header.

## Install

```bash
bunx --bun shadcn@latest add https://robocn.dev/r/scout-walker.json
```

Registry item: `scout-walker` · [`https://robocn.dev/r/scout-walker.json`](https://robocn.dev/r/scout-walker.json)

## Notes

- The roll is the machine. `solveWalker` takes the support polygon the footfall leaves, works out the nearest place inside it the mass can stand, and buys that offset with attitude: the cab sits `hull` above the hip line, so getting the mass over a foot costs `asin(offset / hull)` of roll. In double support the mass is already between the feet and the cab stands level; in single support it heaves over.
- Front elevation is the view it is drawn in, because a roll is a thing a front elevation shows. Every part of the cab goes through the same hull transform the solver put the hips on, so the dropped hip on the loaded side is geometry rather than a drawn pose.
- `advance` runs a duty under a half, which means a flight phase: both feet leave the floor, and the machine reports itself airborne with no margin claimed either way rather than pretending it is balanced.
- Illustrative where it says so: the footfall is a schedule, the load share is that schedule weighted by how near the mass is, and there is no inertia or overturning moment. Off balance means it could not hold that pose standing still.
- An original archetype — a two-legged scout walker — named for its job. No franchise, insignia or paint scheme, here or in the demo; the default palette is the theme's.

## Usage

```tsx
import { ScoutWalker } from "@/components/ui/scout-walker"

<ScoutWalker behavior="patrol" showSupport />

// Or scrub the gait and push the cab off its feet yourself.
<ScoutWalker gait="walk" stride={0.25} lean={{ x: 1, y: 0 }} view="front" />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One walker, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"patrol" | "advance" | "watch" | "static"` | `"patrol"` | Patrol walks a line with a real double support; advance is a low, quick stride with a flight phase; watch stands and scans. |
| `gait` | `"stand" | "walk" | "stride"` | — | Footfall pattern. Omit and the behaviour picks one. |
| `stride` | `number` | — | Controlled gait cycle, 0–1. Supplying it stops the clock. |
| `speed` | `number` | `0.5` | Gait cycles per second. |
| `animate` | `boolean` | `true` | Off parks the machine at phase and stops rendering. A reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze where it stands. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `lean` | `Vec2 | null` | `null` | Controlled attitude push, −1..1 of each stop: x rolls it, y pitches it. It beats the drag, and the gait still runs underneath. |
| `onLeanChange` | `(lean: Vec2) => void` | — | The lean a drag or a key moved it to, reported in controlled mode too. |
| `interactive` | `boolean` | `true` | Press and drag to push the cab off its feet, or use the arrow keys; Home re-centres. Release eases it back into the gait. |
| `height` | `number` | — | Ride height 0–1, clamped to what the legs can still reach once the stride and the attitude stops are paid for. |
| `step` | `number` | — | Foot travel, 0–1. |
| `lift` | `number` | `0.55` | Swing clearance, 0–1. |
| `look` | `Vec2 | null` | `null` | Controlled aim in −1..1: x yaws the cab on its hips, y tips the chin pods. |
| `track` | `boolean` | `true` | The cab follows the page pointer while look is null. |
| `showSupport` | `boolean` | `false` | Draw the support, a ring at each loaded foot sized by its share, and the mass on the plumb line down to where it falls. |
| `variant` | `"solid" | "outline" | "blueprint" | "wire"` | `"solid"` | How the machine is painted. Geometry never changes between variants. |
| `size` | `"xs" | "sm" | "md" | "lg" | "xl" | number` | `"md"` | Rendered width in pixels, or a step on the scale. |
| `showGround` | `boolean` | `true` | Draw the contact line or shadow beneath the droid. |
| `signal` | `"idle" | "ready" | "warning"` | — | Status-lamp state using neutral, accent, or shell colour; each component documents its visual default in the demo. |
| `label` | `string` | — | Optional technical caption under the drawing. |
| `color` | `string` | `var(--robot-shell)` | Body panels — the colour the machine reads as. |
| `accent` | `string` | `var(--robot-accent)` | Status colour: tip light, live tool, readouts. |
| `metal` | `string` | `var(--robot-metal)` | Bare machined parts: collars, bolts, tool bodies. |
| `dark` | `string` | `var(--robot-dark)` | Cast joints, base, shadow side. |
| `palette` | `Partial<RobotPalette>` | — | Override any subset of roles at once, including glow and grid. |

## Source

- `src/components/ui/scout-walker.tsx`
