# Pegasus

One body, two ways of holding it up, and the number between them. lift splits the animal's weight between its legs and its wings, and four things answer it at once: the fetlocks recoil, the legs run out of reach and fold, the stride fades out, and the wingbeat fades in. The wing is three bones solved to a tip tracing a figure of eight.

> 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/robot-pegasus.json
```

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

## Notes

- lift is one load budget shared between two support systems: the legs carry 1 − lift of the body and the wings carry lift, and the leg loads are the gait solver's own numbers scaled by it. That is what makes the fetlocks recoil as the animal goes up rather than being told to.
- The legs fold because they run out of reach, not because a script folds them: the floor stays where it is while the body rises, and once the hoof target is past the limb's own reach the target comes back in along the same line. It is a rule, but one keyed to the geometry.
- Each wing is three bones solved to a wingtip path rather than three scripted angles. The path is a 1:2 Lissajous — one cycle up and down against two fore and aft — which is the figure of eight a wingtip traces, and spread scales the whole path, so folding the wing is the same solve with a nearer target.
- The wings are modelled in three space and go through the camera in their own group, so they are exact from every angle. In a true side elevation a lateral span foreshortens and the two wings very nearly superimpose — that is what a side elevation of a wing is, not a drawing bug. Plan and front show the span.
- No aerodynamics of any kind: the wing generates no modelled lift, and lift is a prop rather than a computed force. No dynamics under the feet either — the load is a static weight distribution, and the rise is a ramp rather than a ballistic trajectory. The animal never travels across its frame.

## Usage

```tsx
import { RobotPegasus } from "@/components/ui/robot-pegasus"

<RobotPegasus behavior="launch" />

// Or work the handover yourself and watch everything answer it.
<RobotPegasus lift={0.5} spread={0.8} beat={0.2} gait="canter" showContacts />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One animal, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `behavior` | `"launch" | "canter" | "soar" | "hover" | "static"` | `"launch"` | What it does when nothing is supplied. launch is the one that crosses the handover; canter stays on the floor; soar and hover are both entirely on the wings. |
| `lift` | `number` | — | The handover, 0 the legs carry the whole animal to 1 the wings do. The one prop the machine is about. Omit and the behavior decides. |
| `spread` | `number` | — | Wing extension, 0 furled against the body to 1 spread. Folding is the tip path closing, not a different drawing. Omit and it comes up with the lift. |
| `beat` | `number` | — | Controlled wingbeat fraction. Omit and it runs off the stride at wingbeats per cycle. |
| `wingbeats` | `number` | — | Wingbeats per stride. Omit and the behavior sets it — a hover beats fastest because it is holding station on the wings alone. |
| `gait` | `"halt" | "walk" | "trot" | "pace" | "canter" | "gallop"` | — | The footfall pattern whatever weight is still on the feet runs. Omit and the behavior picks one. |
| `lead` | `"left" | "right"` | `"right"` | Which foreleg lands last, for the canter and the gallop. |
| `phase` | `number` | — | Controlled stride fraction. Supplying it stops the internal clock. |
| `speed` | `number` | `0.5` | Strides per second. |
| `offset` | `number` | `0` | Seconds of offset, so a flight of them breaks step. |
| `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. |
| `arch` | `number` | — | Back curvature, −1 hollowed to 1 roached. Omit and the behavior sets it. |
| `crouch` | `number` | — | Leg fold, 0 standing tall to 1 dropped. Omit and the behavior decides. |
| `neck` | `number` | — | Neck carriage, −1 head to the floor to 1 head high. Omit and the behavior sets it. |
| `tail` | `number` | — | Tail carriage, −1 clamped under the quarters to 1 flagged out behind. |
| `ears` | `number` | — | Ears, −1 pinned back to 1 pricked forward. Omit and they prick at the pointer. |
| `gaze` | `number` | — | Head and eye aim, −1..1. Omit and it follows the pointer. |
| `interactive` | `boolean` | `true` | Drag up and down to work the handover — the frame's height is the whole of it — with arrows stepping 10% and shift 25%, Home on the floor and End in the air. The head tracks the pointer. |
| `onLiftChange` | `(lift: number) => void` | — | Fired with the handover, 0–1. |
| `showGround` | `boolean` | `true` | The ground line and the shadow, which shrinks as it leaves the floor. |
| `showContacts` | `boolean` | `false` | Mark the hooves still carrying weight. |
| `label` | `string` | — | Caption underneath the animal. |
| `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. |
| `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/robot-pegasus.tsx`
