preseed/tendril/cave.module — procedural cavern environment for the crawler
part. Sweeps a noise-displaced cave tube along the part path, closes both
ends with pinched dead-ends, scatters stalactites / stalagmites / columns /
rubble, and raises crystal shard clusters. Geometry lives in ten_cave_*
mesh assets (created on first use, shared across builds and boots), so a
persistent set restores its baked lightmaps. Every rock surface
wears tendril_rock (triplanar cave_rock shader), and the tunnel entity
carries a Tessellation component whose negative displacement scale pushes
the walls OUTWARD from the same rock_height map the shader shades cavity
from — so the displaced geometry and the shading always agree, and the
creature's clearance never shrinks.
hash3(xi: ?, yi: ?, zi: ?) → void
| arg | type | description |
|---|
| xi | ? | |
| yi | ? | |
| zi | ? | |
vnoise(x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
fbm3(x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
randRange(lo: ?, hi: ?) → void
| arg | type | description |
|---|
| lo | ? | |
| hi | ? | |
evalPath(path: ?, d: ?) → void
| arg | type | description |
|---|
| path | ? | |
| d | ? | |
evalCenter(path: ?, d: ?) → void
| arg | type | description |
|---|
| path | ? | |
| d | ? | |
ringBasis(path: ?, dd: ?, L: ?) → void
ring frame at arc distance dd: smoothed center, tangent, right, up, pinch
| arg | type | description |
|---|
| path | ? | |
| dd | ? | |
| L | ? | |
profilePoint(a: ?, w: ?, h: ?) → void
cross-section point at loop parameter a (0 = floor center, pi = ceiling
apex). Returns lateral, vertical offsets in the ring plane plus the 0..1
height fraction.
| arg | type | description |
|---|
| a | ? | |
| w | ? | |
| h | ? | |
surfacePoint(path: ?, dd: ?, a: ?, L: ?) → void
displaced cave surface point at (dd, a): position, outward radial dir,
height fraction. The single source of truth used by both the tunnel mesh
and prop placement, so props always sit ON the wall they were aimed at.
| arg | type | description |
|---|
| path | ? | |
| dd | ? | |
| a | ? | |
| L | ? | |
buildTunnelGeom(path: ?) → void
tri(a: ?, b: ?, c: ?) → void
| arg | type | description |
|---|
| a | ? | |
| b | ? | |
| c | ? | |
cap(ri: ?, sign: ?) → void
pinched dead-end caps
| arg | type | description |
|---|
| ri | ? | |
| sign | ? | |
lathe(rings: ?, segs: ?, len: ?, dirY: ?, radiusFn: ?, seed: ?) → void
revolve a radius profile around Y. dirY -1 hangs down (stalactite).
| arg | type | description |
|---|
| rings | ? | |
| segs | ? | |
| len | ? | |
| dirY | ? | |
| radiusFn | ? | |
| seed | ? | |
rubbleGeom(seed: ?) → void
irregular rock chunk: displaced sphere, slightly squashed
clusterGeom(seed: ?, count: ?) → void
cluster of faceted crystal shards growing from a base point
| arg | type | description |
|---|
| seed | ? | |
| count | ? | |
face(v1: ?, v2: ?, v3: ?, v4: ?) → void
| arg | type | description |
|---|
| v1 | ? | |
| v2 | ? | |
| v3 | ? | |
| v4 | ? | |
meshAsset(name: ?, geomFn: ?) → void
The generated names are probed with `asset.exists`, a store check that reads
whether the files are there without pinning a content dependency, and the
handle comes back through `asset.ref`.
| arg | type | description |
|---|
| name | ? | |
| geomFn | ? | |
ensureMeshes(path: ?) → void
spawnProp(ctx: ?, name: ?, mesh: ?, mat: ?, pos: ?, yaw: ?, scale: ?, persistent: ?) → void
rock props are static Models: lightmap receivers and occluders for the
GI bake. `persistent` spawns a durable world entity (the baked set the
film restores) instead of a part-lifetime one.
| arg | type | description |
|---|
| ctx | ? | |
| name | ? | |
| mesh | ? | |
| mat | ? | |
| pos | ? | |
| yaw | ? | |
| scale | ? | |
| persistent | ? | |
spawnCrystalCluster(ctx: ?, pos: ?, scale: ?, persistent: ?) → void
spawn a crystal shard cluster; the caller owns any Light it wants on it.
Shards attach as a raw ecs mesh, which keeps them out of the GI bake's
traced scene: the caller's Light sits at the cluster's centre, and shadow
rays must start clear of the shard geometry around it.
| arg | type | description |
|---|
| ctx | ? | |
| pos | ? | |
| scale | ? | |
| persistent | ? | |
build(ctx: ?, path: ?, opts: ?) → void
Build the whole cavern along `path`. Spawns the tessellated tunnel plus
scattered formations; every entity is ctx.track'd for part teardown.
`opts.persistent` spawns durable world entities instead — the baked set
the film finds already standing.
| arg | type | description |
|---|
| ctx | ? | |
| path | ? | |
| opts | ? | |