pub enum CameraProjection {
WebMercator,
Equirectangular,
Globe,
VerticalPerspective {
center: GeoCoord,
camera_height: f64,
},
}Expand description
Camera-facing map projection selection.
Variants§
WebMercator
Web Mercator (EPSG:3857).
Equirectangular
Equirectangular / Plate Carree.
Globe
Globe / geocentric Earth-centered projection.
VerticalPerspective
Near-sided vertical perspective projection onto a tangent plane.
Implementations§
Source§impl CameraProjection
impl CameraProjection
Sourcepub fn support_level(&self) -> ProjectionSupport
pub fn support_level(&self) -> ProjectionSupport
Release-support classification for this projection.
Sourcepub fn is_stable_for_v1(&self) -> bool
pub fn is_stable_for_v1(&self) -> bool
Whether this projection is part of the intended stable v1.0 surface.
Sourcepub fn is_experimental_for_v1(&self) -> bool
pub fn is_experimental_for_v1(&self) -> bool
Whether this projection should be treated as experimental in v1.0.
Sourcepub fn vertical_perspective(center: GeoCoord, camera_height: f64) -> Self
pub fn vertical_perspective(center: GeoCoord, camera_height: f64) -> Self
Construct a vertical-perspective projection from a center point and viewer height.
Sourcepub fn center(&self) -> Option<GeoCoord>
pub fn center(&self) -> Option<GeoCoord>
Return the configured center for center-aware projections.
Sourcepub fn camera_height(&self) -> Option<f64>
pub fn camera_height(&self) -> Option<f64>
Return the configured viewer height for vertical perspective.
Sourcepub fn is_tile_compatible(&self) -> bool
pub fn is_tile_compatible(&self) -> bool
Whether this projection is fully compatible with the current slippy-map tile and terrain update path.
Sourcepub fn project(&self, geo: &GeoCoord) -> WorldCoord
pub fn project(&self, geo: &GeoCoord) -> WorldCoord
Project a geographic coordinate into engine world space.
Sourcepub fn unproject(&self, world: &WorldCoord) -> GeoCoord
pub fn unproject(&self, world: &WorldCoord) -> GeoCoord
Inverse-project engine world space back into geographic coordinates.
Sourcepub fn scale_factor(&self, geo: &GeoCoord) -> f64
pub fn scale_factor(&self, geo: &GeoCoord) -> f64
Projection-local scale factor at the given geographic coordinate.
Sourcepub fn max_extent(&self) -> f64
pub fn max_extent(&self) -> f64
Maximum useful half-extent for camera clamping and wrapping.
Sourcepub fn world_size(&self) -> f64
pub fn world_size(&self) -> f64
Full projected world width in meters.
Sourcepub fn project_position(&self, geo: &GeoCoord) -> [f64; 3]
pub fn project_position(&self, geo: &GeoCoord) -> [f64; 3]
Project a geographic coordinate into the active planar world space as raw XYZ meters.
Sourcepub fn tile_geo_bounds(&self, tile: &TileId) -> GeoBounds
pub fn tile_geo_bounds(&self, tile: &TileId) -> GeoBounds
Geographic bounds for a slippy-map tile, expressed as south-west and north-east corners.
Sourcepub fn project_tile_corner(&self, tile: &TileId, u: f64, v: f64) -> [f64; 3]
pub fn project_tile_corner(&self, tile: &TileId, u: f64, v: f64) -> [f64; 3]
Project a tile corner into the active planar world space.
Sourcepub fn project_tile_center(&self, tile: &TileId) -> [f64; 3]
pub fn project_tile_center(&self, tile: &TileId) -> [f64; 3]
Project the geographic centre of a tile into planar world space.
This is equivalent to averaging the four projected corners but requires only a single projection call, making it ~4× cheaper for the per-frame tile reposition path.
Trait Implementations§
Source§impl Clone for CameraProjection
impl Clone for CameraProjection
Source§fn clone(&self) -> CameraProjection
fn clone(&self) -> CameraProjection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more