rustial-engine 0.0.1

Framework-agnostic 2.5D map engine for rustial
Documentation
//! 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)),
        }
    }
}