qaxis(axis: V, deg: number) → Q
| arg | type | description |
|---|
| axis | V | |
| deg | number | |
tag(b: Builder, name: string, kind: string?) → void
Parts drawn between `M.tag(b, name, kind)` and `M.untag(b)` are an accessory (a hat, a helmet, a
held prop, an outfit piece): they go into groups of their own, keyed "acc:<name>:<kind>:<material>",
so the look can draw (and a game can hide, pop off or break) them apart from the segment.
| arg | type | description |
|---|
| b | Builder | |
| name | string | |
| kind | string? | |
untag(b: Builder) → void
| arg | type | description |
|---|
| b | Builder | |
group(b: Builder, mat: string) → Group
| arg | type | description |
|---|
| b | Builder | |
| mat | string | |
sp(c: number, m: number) → number
| arg | type | description |
|---|
| c | number | |
| m | number | |
blob(b: Builder, o: BlobOpts) → void
A superquadric blob: e = eh = 2 is an ellipsoid; larger exponents square it off with a soft bevel.
| arg | type | description |
|---|
| b | Builder | |
| o | BlobOpts | |
ball(b: Builder, at: V, r: number, color: any, mat: string?) → void
A sphere shortcut.
| arg | type | description |
|---|
| b | Builder | |
| at | V | |
| r | number | |
| color | any | |
| mat | string? | |
tube(b: Builder, o: TubeOpts) → void
A tube along a polyline (smiles, antennae, plumes, ribs, straps), capped with balls.
| arg | type | description |
|---|
| b | Builder | |
| o | TubeOpts | |
arc(c: V, r: number, a0: number, a1: number, ex: V, ey: V, steps: number?) → void
Points on an arc in a plane: centre c, radius r, from angle a0 to a1 (degrees), in the plane
spanned by unit vectors ex and ey.
| arg | type | description |
|---|
| c | V | |
| r | number | |
| a0 | number | |
| a1 | number | |
| ex | V | |
| ey | V | |
| steps | number? | |
orient(g: Group) → void
Fix winding: every triangle is wound so its face agrees with the normals it carries.
finish(b: Builder) → void
Turn a builder into runtime meshes: { [groupKey] = MeshHandle } (a plain material name, or "acc:<name>:<kind>:<material>" for an accessory), plus each group's bounds { [groupKey] = { min = {x,y,z}, max = {x,y,z} } } in the segment's frame.
| arg | type | description |
|---|
| b | Builder | |
⌬ Types
Group = { pos: { number }, nrm: { number }, col: { number }, idx: { number } }Builder = { groups: { [string]: Group } }BlobOpts = {TubeOpts = { path: { V }, r: number | { number }, color: any, mat: string?, sides: number?, caps: boolean? }