pub struct TerrainMeshData {
pub tile: TileId,
pub elevation_source_tile: TileId,
pub elevation_region: TileTextureRegion,
pub positions: Vec<[f64; 3]>,
pub uvs: Vec<[f32; 2]>,
pub normals: Vec<[f32; 3]>,
pub indices: Vec<u32>,
pub generation: u64,
pub grid_resolution: u16,
pub vertical_exaggeration: f32,
pub elevation_texture: Option<TerrainElevationTexture>,
}Expand description
CPU-side terrain mesh data ready for GPU upload.
Fields§
§tile: TileIdTile this mesh represents.
elevation_source_tile: TileIdElevation source tile that backs this mesh.
When terrain display zoom exceeds the DEM source max zoom, multiple child meshes reuse a parent DEM tile. This field identifies that parent.
elevation_region: TileTextureRegionNormalized sub-region of the elevation texture to sample for this mesh.
FULL when the elevation texture matches the display tile. For
overzoomed terrain meshes this is the child sub-rect inside the parent
DEM tile.
positions: Vec<[f64; 3]>Vertex positions in world-space (f64 for precision, cast to f32 at upload).
For the reusable-grid path these positions represent the planar base
surface before elevation displacement. Elevation is supplied separately
via [elevation_texture] for GPU sampling.
uvs: Vec<[f32; 2]>Texture coordinates.
normals: Vec<[f32; 3]>Surface normals.
For reusable-grid terrain these are base-grid normals. Final terrain shading may derive finer normals in the renderer from sampled heights.
indices: Vec<u32>Triangle indices.
generation: u64Generation counter from the terrain manager’s elevation cache.
Increments whenever the elevation source delivers new data. Renderers compare this against the value stored on their entity to detect when a mesh must be rebuilt (e.g. when a flat placeholder is replaced by real elevation data).
grid_resolution: u16Grid resolution used to build the reusable terrain mesh.
vertical_exaggeration: f32Vertical exaggeration already selected for this tile.
elevation_texture: Option<TerrainElevationTexture>Optional GPU-sampleable elevation payload for this tile.
Trait Implementations§
Source§impl Clone for TerrainMeshData
impl Clone for TerrainMeshData
Source§fn clone(&self) -> TerrainMeshData
fn clone(&self) -> TerrainMeshData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more