Skip to main content

Module terrain3d

Module terrain3d 

Source
Expand description

Incremental mesh construction for tiled terrain, relief walls, building prisms, and their roofs.

The reference rebuilds per-tile height fields and building geometry every frame. Geometry3D can already carry arbitrary vertices, but a scene built from hundreds of tiles and thousands of buildings must not reallocate in the frame hot path. MeshBuilder owns reusable vertex and index capacity; a rebuild clears and refills it, so steady-state frames allocate nothing.

Coordinates are f64 because tiled geometry is authored at Earth scale. MeshBuilder::finish subtracts an RTC origin before narrowing, which is the same contract as crate::camera64::RenderFrame64.

Structsยง

MeshBuilder
Reusable builder for a textured mesh at Earth scale.
RteMeshBuilder
Builder for GPU Relative-To-Eye (RTE) mesh buffers storing interleaved [pos_high: 3, pos_low: 3, norm: 3, uv: 2] = 11 floats per vertex.