pub struct QuantizedMeshHeader {
pub center: [f64; 3],
pub min_height: f32,
pub max_height: f32,
pub bounding_sphere_center: [f64; 3],
pub bounding_sphere_radius: f64,
pub horizon_occlusion_point: [f64; 3],
}Expand description
Quantized mesh header (88 bytes).
All coordinates are in Earth-Centered Earth-Fixed (ECEF) frame.
Fields§
§center: [f64; 3]Center of the tile in ECEF coordinates (meters)
min_height: f32Minimum height in the tile (meters)
max_height: f32Maximum height in the tile (meters)
bounding_sphere_center: [f64; 3]Bounding sphere center in ECEF coordinates (meters)
bounding_sphere_radius: f64Bounding sphere radius (meters)
horizon_occlusion_point: [f64; 3]Horizon occlusion point in ellipsoid-scaled ECEF coordinates
Implementations§
Source§impl QuantizedMeshHeader
impl QuantizedMeshHeader
Sourcepub fn from_bounds(
bounds: &TileBounds,
min_height: f32,
max_height: f32,
) -> Self
pub fn from_bounds( bounds: &TileBounds, min_height: f32, max_height: f32, ) -> Self
Create a header from tile bounds and height range.
Computes ECEF coordinates, bounding sphere, and horizon occlusion point.
Falls back to corner+edge sample points for the horizon occlusion —
callers that have the actual mesh vertices should prefer
from_bounds_with_vertices_iter
for tighter occlusion.
Sourcepub fn from_bounds_with_vertices_iter<I>(
bounds: &TileBounds,
min_height: f32,
max_height: f32,
vertices_geodetic: I,
) -> Self
pub fn from_bounds_with_vertices_iter<I>( bounds: &TileBounds, min_height: f32, max_height: f32, vertices_geodetic: I, ) -> Self
Like from_bounds, but uses the supplied mesh
vertices (geodetic [lon, lat, height]) to compute a tighter horizon
occlusion point via the Cesium EllipsoidalOccluder algorithm.
Accepts any IntoIterator<Item = [f64; 3]>, so callers can stream
directly from a flat &[f32] buffer or any other source without
allocating an intermediate Vec. To feed an f32 mesh, adapt with
chunks_exact(3).map(|c| [c[0] as f64, c[1] as f64, c[2] as f64]).
Internal math runs in f64 regardless of input precision — ECEF
coordinates at Earth scale need f64 to keep sub-metre accuracy.
Sourcepub fn from_bounds_with_vertices(
bounds: &TileBounds,
min_height: f32,
max_height: f32,
vertices_geodetic: &[(f64, f64, f64)],
) -> Self
👎Deprecated since 0.2.1: Use from_bounds_with_vertices_iter to avoid allocating an intermediate Vec<(f64, f64, f64)>
pub fn from_bounds_with_vertices( bounds: &TileBounds, min_height: f32, max_height: f32, vertices_geodetic: &[(f64, f64, f64)], ) -> Self
Use from_bounds_with_vertices_iter to avoid allocating an intermediate Vec<(f64, f64, f64)>
Slice-based wrapper around
from_bounds_with_vertices_iter.
Retained for backward compatibility; prefer the iterator form when
your vertex data is in a layout (Vec<f32>, GPU buffer, …) that
would otherwise require allocating an intermediate Vec<(f64, f64, f64)>.
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Deserialize header from bytes.
Trait Implementations§
Source§impl Clone for QuantizedMeshHeader
impl Clone for QuantizedMeshHeader
Source§fn clone(&self) -> QuantizedMeshHeader
fn clone(&self) -> QuantizedMeshHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more