groundCoverAt

function groundCoverAt
universe/src/terrain.ts:498
groundCoverAt(surface: SurfaceParameters, direction: Vec3, out: Uint8Array<ArrayBufferLike> | null, at: number, seabed: boolean, water: Float32Array<ArrayBufferLike> | null, waterAt: number) → number

The ground below a direction as it is drawn, with what it is made of written into out.

The sea clamp applies to the height and not to the cover: an ocean is a surface the renderer draws over the elevation it is handed, and the seabed's own composition is what shows through a shallow one. See groundElevation for why the clamp has exactly one owner, and drawnGroundElevation for the one reader that asks for the seabed with seabed set.

The micro tail goes in before the clamp rather than after it, and that is what keeps a shoreline continuous. Added afterward it would rough up the open sea by the whole bound — the one surface in this model that is flat by definition — and a gate on "is this dry" would put a step at the waterline of the same height. Under the clamp, submarine grit is flattened by the same max that flattens the seabed, and ground that the tail lifts out of shallow water is an island, which is what an eight-meter crater rim standing in four meters of water is.

surfaceSurfaceParameters
Undocumented
directionVec3
Undocumented
outUint8Array<ArrayBufferLike> | null
Undocumented
atnumber
Undocumented
seabedboolean
Undocumented
waterFloat32Array<ArrayBufferLike> | null
Undocumented
waterAtnumber
Undocumented
Returnsnumber