toWorld(p: V3) → V3 return
partById(id: string?) → any
| arg | type | description |
|---|
| id | string? | |
cameraPose(fovDeg: number?, aspect: number?, frame: any?) → void
World eye and look-at points of the build camera (with the garage layout's frame offset from Rules.state().shotFrame applied when `fovDeg`/`aspect` are given).
| arg | type | description |
|---|
| fovDeg | number? | |
| aspect | number? | |
| frame | any? | |
setView(name: string) → void
Jump the camera to a preset: "front" | "side" | "top" | "iso" | "back".
| arg | type | description |
|---|
| name | string | |
focus(ids: { string }?) → void
Frame parts (default: the selection, else the whole bot).
| arg | type | description |
|---|
| ids | { string }? | |
orbit(dx: number, dy: number) → void
| arg | type | description |
|---|
| dx | number | |
| dy | number | |
zoom(f: number) → void
| arg | type | description |
|---|
| f | number | |
pan(dxPx: number, dyPx: number) → void
| arg | type | description |
|---|
| dxPx | number | |
| dyPx | number | |
stepCamera(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
rayAt(x: number, y: number) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
toScreen(p: V3) → void
Screen pixels of a bot-space point (nil when behind the camera).
pointsPerPixel( ) → number
Scene pixels (pointer, worldToScreen) -> ui layout points (ui.screenSize space).
blocked(x: number, y: number) → boolean
| arg | type | description |
|---|
| x | number | |
| y | number | |
standInColor(d: any, p: any) → void
| arg | type | description |
|---|
| d | any | |
| p | any | |
standInShape(e: any, d: any, p: any) → void
| arg | type | description |
|---|
| e | any | |
| d | any | |
| p | any | |
standInPose(e: any, p: any) → void
| arg | type | description |
|---|
| e | any | |
| p | any | |
updatePartVisual(id: string) → void
| arg | type | description |
|---|
| id | string | |
refreshDynamic( ) → void
Overlays that follow the design: centre of mass, wheel contact, strike zones.
outlineMesh(p: any, w: number) → any
| arg | type | description |
|---|
| p | any | |
| w | number | |
refreshOutlines( ) → void
outlineFollow(id: string) → void
| arg | type | description |
|---|
| id | string | |
arrowMesh(axis: string, tip: string) → any
| arg | type | description |
|---|
| axis | string | |
| tip | string | |
planeMesh(pl: string) → any
| arg | type | description |
|---|
| pl | string | |
p(s: number, t: number) → V3 return
| arg | type | description |
|---|
| s | number | |
| t | number | |
ringMesh(axis: string) → any
| arg | type | description |
|---|
| axis | string | |
selectionPivot( ) → void
Selection pivot (bot space) and the first selected part.
gizmoScale(pivot: V3) → number
| arg | type | description |
|---|
| pivot | V3 | |
handlesFor(tool: string, part: any) → void
Handles of the current tool: { name, kind = "axis"|"plane"|"ring", axis (bot-space unit), [plane normal], color }
| arg | type | description |
|---|
| tool | string | |
| part | any | |
pickHandle(x: number, y: number) → string
The handle under screen point (x, y), within a few pixels.
| arg | type | description |
|---|
| x | number | |
| y | number | |
ghostEntity(name: string, color: { number }) → any
| arg | type | description |
|---|
| name | string | |
| color | { number } | |
poseGhost(g: any, p: any) → void
| arg | type | description |
|---|
| g | any | |
| p | any | |
showGhost(g: any, on: boolean) → void
| arg | type | description |
|---|
| g | any | |
| on | boolean | |
snapFn(v: number) → number
| arg | type | description |
|---|
| v | number | |
ghostAt(x: number, y: number) → any
Ghost pose for the pointer at (x, y); nil when nothing to place on.
| arg | type | description |
|---|
| x | number | |
| y | number | |
active( ) → boolean
True while the build view is up (attached by editor.BuildView).
beginPlace(typeName: string) → void
Start placing a new part of `typeName`: a ghost follows the pointer, a click or tap places it.
| arg | type | description |
|---|
| typeName | string | |
cancelPlace( ) → void
Stop placing.
placing( ) → string
The part type being placed, or nil.
setTool(tool: string) → void
Pick the gizmo tool: "select" | "move" | "rotate" | "scale".
| arg | type | description |
|---|
| tool | string | |
tool( ) → string
The current tool.
hovered( ) → string
The part under the pointer (nil when none).
hoveredHandle( ) → string
The gizmo handle under the pointer (nil when none).
dragging( ) → boolean
True while a gizmo drag runs.
setPointerBlocker(fn: ((number, number) → void
fn(x, y) -> boolean, in ui logical points: true over a garage panel (the view ignores presses, hover, wheel and touches that start there).
| arg | type | description |
|---|
| fn | ((number, number | |
setPadEnabled(on: boolean) → void
Hand the gamepad's D-pad and shoulders to the view (nudge / rotate the selection) or take them back.
| arg | type | description |
|---|
| on | boolean | |
setOverlays(t: any) → void
Toggle overlays: { com, contacts, strike, mirror, bounds, grid, issues } = booleans (partial).
on(fn: (any) → void
Subscribe to view events { kind = "tool"|"place"|"hover"|"view"|"drag", ... }. Returns an unsubscribe function.
stats( ) → any
Build-view costs: { mode = "assembler"|"standIn", buildMs, lastUpdateMs, dragFrames, dragMsAvg, dragMsMax }.
resetStats( ) → void
Clear the drag cost counters.
beginDrag(handle: string, x: number, y: number) → void
| arg | type | description |
|---|
| handle | string | |
| x | number | |
| y | number | |
stepDrag(x: number, y: number) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
cancelDrag( ) → void
Cancel a running gizmo drag (restores the parts).
handleScreen(name: string, t: number?) → void
Screen pixels of a point on a gizmo handle of the current tool: an axis handle at fraction `t` of its length (default 0.6), a plane handle's centre, a ring at angle `t` radians. Nil when that handle is not shown.
| arg | type | description |
|---|
| name | string | |
| t | number? | |
placeAt(x: number, y: number, keepPlacing: boolean) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
| keepPlacing | boolean | |
clickSelect(x: number, y: number, add: boolean) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
| add | boolean | |
nudge(dx: number, dz: number) → void
| arg | type | description |
|---|
| dx | number | |
| dz | number | |
turn(dir: number) → void
| arg | type | description |
|---|
| dir | number | |
bindControls(controls: any) → void
| arg | type | description |
|---|
| controls | any | |
on(name: string, fn: () → void
| arg | type | description |
|---|
| name | string | |
| fn | ( | |
pad(name: string, fn: () → void
| arg | type | description |
|---|
| name | string | |
| fn | ( | |
readPointer( ) → any
One pointer per frame: mouse, or the primary touch contact when the mouse
path is not carrying it.
handlePointer(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
onSession(change: any) → void
| arg | type | description |
|---|
| change | any | |
attach(root: any, controls: any?) → void
Attach the view under `root` (editor.BuildView's entity) with the activated control handles. Builds the stand and the bot.
| arg | type | description |
|---|
| root | any | |
| controls | any? | |
detach( ) → void
Detach the view (editor.BuildView's onDestroy). Cancels a running drag.
tick(dt: number) → void
Advance the view one frame: input, camera, visuals. Called by editor.BuildView.
| arg | type | description |
|---|
| dt | number | |