geo — the geometry of the sea cliff, built as runtime meshes.
Everything the cliff is made of comes out of here: the face itself (one
displaced grid with columnar grooves and a broken skyline), a shelf with a
real lip and an undercut for every ledge in CF.layout, the three kinds of
food, the debris a crumbling ledge throws, and the props on the roost.
Every builder returns a MeshHandle from `renderer.mesh.create`, which the
`Model` component's `model` field takes directly, so none of this becomes an
asset on disk. It is deterministic: the same seed builds the same cliff on
every peer.
Owned by the cliff slice.
hash2(x: number, y: number) → number
Deterministic value noise. The same field the basalt shader uses at a
different scale, so the modelled relief and the shaded relief agree.
| arg | type | description |
|---|
| x | number | |
| y | number | |
vnoise(x: number, y: number) → number
| arg | type | description |
|---|
| x | number | |
| y | number | |
fbm(x: number, y: number, octaves: number) → number
| arg | type | description |
|---|
| x | number | |
| y | number | |
| octaves | number | |
vert(b: Builder, x: number, y: number, z: number, u: number, v: number) → number
| arg | type | description |
|---|
| b | Builder | |
| x | number | |
| y | number | |
| z | number | |
| u | number | |
| v | number | |
tri(b: Builder, a: number, c: number, d: number) → void
| arg | type | description |
|---|
| b | Builder | |
| a | number | |
| c | number | |
| d | number | |
quad(b: Builder, v00: number, v01: number, v10: number, v11: number) → void
| arg | type | description |
|---|
| b | Builder | |
| v00 | number | |
| v01 | number | |
| v10 | number | |
| v11 | number | |
finish(b: Builder, flatShade: boolean?) → any
Accumulate face normals onto the vertices, then normalize. A mesh built by
any of the builders below gets its normals from its own triangles, so a
displaced grid and an extruded profile shade the same way.
| arg | type | description |
|---|
| b | Builder | |
| flatShade | boolean? | |
faceZ(x: number, y: number) → number
One displaced grid. Relief is fbm plus vertical column grooves; the sides
curve hard away from the camera so the cliff never shows its edge, and the
top row breaks into a jagged skyline at the summit.
The depth of the face at a point. Public because the shelves and the props
tuck themselves into whatever it turns out to be.
Columnar basalt is not a grooved wall — it is a palisade of prisms. Each
column stands at its own depth with FLAT sides and a hard seam against its
neighbour, and cross-joints break every column into stacked blocks. So the
depth is piecewise constant per (column, block) rather than a smooth field,
and the mesh grid resolves each seam as a real facet edge that catches the
raking moonlight.
| arg | type | description |
|---|
| x | number | |
| y | number | |
face(opts: any) → any
| arg | type | description |
|---|
| opts | any | |
grid(opts: any) → any
A flat grid in the XZ plane, for a surface whose shape comes from its
shader's own vertex stage rather than from the mesh.
| arg | type | description |
|---|
| opts | any | |
ridge(opts: any) → any
A wall whose TOP EDGE is a ridgeline: the headland further along the coast,
standing behind the climbed face. It is what stops sky appearing beside the
cliff on a wide screen, and it gives the fog something to sit in front of.
| arg | type | description |
|---|
| opts | any | |
crestAt(x: number) → number
| arg | type | description |
|---|
| x | number | |
shelf(opts: any) → any
Extrude a six-point profile — back of the top, the crown, the front edge,
the lip's face, the undercut, the back of the bottom — along x, with the
front edge and the top wandering per column. Local origin sits at the point
CF.landing tests: x at the ledge's centre, y at its top surface, z at 0.
| arg | type | description |
|---|
| opts | any | |
sphere(rings: number, segs: number, jitter: number?, seed: number?) → any
| arg | type | description |
|---|
| rings | number | |
| segs | number | |
| jitter | number? | |
| seed | number? | |
cone(segs: number, seed: number?) → any
| arg | type | description |
|---|
| segs | number | |
| seed | number? | |
petal( ) → any
A petal of the crowfoot blossom: a cupped leaf lying in the XZ plane, its
base at the origin and its tip at +z, so an entity rotating about X opens it.
chunk(seed: number) → any
An irregular rock chip, for the debris a crumbling ledge throws and for the
boulders on the strand.
| arg | type | description |
|---|
| seed | number | |
stick(seed: number) → any
A weathered stick, for the nest on the roost.
| arg | type | description |
|---|
| seed | number | |