1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Terrain configuration.
use crate::terrain::elevation_source::{ElevationSource, FlatElevationSource};
/// Configuration for the terrain elevation system.
pub struct TerrainConfig {
/// Whether terrain rendering is enabled.
pub enabled: bool,
/// Vertical exaggeration factor (1.0 = real scale).
pub vertical_exaggeration: f64,
/// Number of vertices per tile edge for terrain mesh subdivision.
pub mesh_resolution: u16,
/// Skirt depth in meters (hides seams between tiles at different LODs).
pub skirt_depth: f64,
/// Maximum zoom level supported by the elevation source.
///
/// When a desired terrain tile exceeds this zoom, the manager
/// fetches elevation from a clamped parent tile and reuses that
/// data. This prevents flat/missing terrain for tiles near the
/// camera whose covering-tiles zoom exceeds the source's max.
///
/// Defaults to 15 (common for AWS / Mapbox terrain services).
pub source_max_zoom: u8,
/// The elevation data source.
pub source: Box<dyn ElevationSource>,
}
impl Default for TerrainConfig {
fn default() -> Self {
Self {
enabled: false,
vertical_exaggeration: 1.0,
mesh_resolution: 64,
skirt_depth: 100.0,
source_max_zoom: 15,
source: Box::new(FlatElevationSource::new(64, 64)),
}
}
}