alpineKit.package
This package holds more than this page lists. See all of its files in its world.
README.md
LakeSurface
The lake's water surface as a mesh of its own. build(plan, height, { parent, material }) floods a 1 m grid from the lake's centre at plan.lake.level, using height(x, z) for the ground, and stands the water on a child entity with a Model. A point the lake covers sits at exactly the lake level; every other point sits at least SINK metres (0.6) under both the ground and the level, so the surface can never rise above the lake over a bank, a gully or the trail beside it. Answers { entity, mesh, cells, verts }, or nil when the plan has no lake.
Called by MountainBuilder, which turns the terrain's built-in water sheet off. That sheet tucks dry points only a quarter of a cell under the ground, so far from the camera it could bridge across a cutting as a flat sheet of water standing in the air.
local LakeSurface = require("alpineKit.LakeSurface")
local lake = LakeSurface.build(plan, function(x, z) return terrain:heightAt(x, z) end, { parent = root, material = lakeMaterial })