Skip to main content

encode_terrain

Function encode_terrain 

Source
pub fn encode_terrain(
    elevations: &[f32],
    grid_size: u32,
    bounds: &TileBounds,
    options: &TerrainOptions,
) -> Vec<u8> โ“˜
Expand description

Encode a flat row-major (north โ†’ south) f32 elevation grid to a quantized-mesh .terrain byte vector.

elevations.len() must equal grid_size * grid_size.

ยงPanics

Panics if the length check fails, or for the panics listed on encode_terrain_from_fn.