pub trait ElevationSource: Debug {
// Required methods
fn elevation(&self, id: u32, p: WorldPos) -> f64;
fn kind(&self) -> &'static str;
// Provided methods
fn z_range(&self) -> (f64, f64) { ... }
fn elevations(&self, ids: &[u32], pos: &[WorldPos], out: &mut Vec<f64>) { ... }
}Expand description
How high is feature id?
facett-map3d is, in its entirety, one implementation of this trait: a 3D
map is a 2D map whose elevation is a heightfield instead of 0.0. A graph in
3D is the same statement with centrality or risk on the Z axis.
Required Methods§
Sourcefn elevation(&self, id: u32, p: WorldPos) -> f64
fn elevation(&self, id: u32, p: WorldPos) -> f64
Height of feature id, given the world position the PositionSource
produced (a terrain source samples at p; a metric source ignores p).
fn kind(&self) -> &'static str
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".