Skip to main content

ElevationSource

Trait ElevationSource 

Source
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§

Source

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).

Source

fn kind(&self) -> &'static str

Provided Methods§

Source

fn z_range(&self) -> (f64, f64)

The [min, max] this source can ever emit — the culler needs it to grow 2D bounds into 3D ones without sampling every feature.

Source

fn elevations(&self, ids: &[u32], pos: &[WorldPos], out: &mut Vec<f64>)

Batch form; default loops.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§