WaterPatch

interface WaterPatch

The sea over a patch: the datum sphere, meshed on the patch's own grid.

A second surface rather than a color on the first, because a shore seen from a landed ship is a flat sheet meeting a slope, and the ground under it is a seabed the sheet is looked through. The vertices are anchor-relative for the reason the patch's are, and they morph onto the parent's grid for the reason the patch's do: the parent's sheet is the parent's chord of the same sphere, and a child whose sheet did not slide onto it would show a sliver of seabed along every level boundary. depths is the one thing the material cannot derive — the ground under the sheet — and it morphs with the rest so the shallows do not shimmer at the handover.

terrainMesh.ts:94

Members

boundsCenterreadonly

boundsCenter: Vec3

Bounding sphere in the same anchor-relative axes the vertices are in.

boundsRadiusreadonly

boundsRadius: number

depthsreadonly

depths: Float32Array

Water level minus the ground, meters, never negative. Zero where the ground is dry.

morphDepthsreadonly

morphDepths: Float32Array

morphPositionsreadonly

morphPositions: Float32Array

Where each vertex sits once fully morphed onto the parent's grid.

positionsreadonly

positions: Float32Array

xyz triples in body-fixed axes, relative to the patch's anchor, at each vertex's own water level: the sea's datum, a lake's spill or a river's surface, whichever stands highest there — and a step under the ground where nothing does, so the sheet hides rather than z-fights.