pub struct TerrainData {
pub name: String,
pub resolution: u32,
pub scale: [f32; 3],
pub heights: Vec<i16>,
pub holes: Option<Vec<u8>>,
pub layers: Vec<Option<ObjRef>>,
pub alphamaps: Vec<Option<ObjRef>>,
pub alphamap_resolution: u32,
pub tree_prototypes: Vec<Option<ObjRef>>,
pub trees: Vec<TreeInstance>,
}Expand description
A TerrainData as stored.
Fields§
§name: Stringm_Name.
resolution: u32Samples along each side of the heightmap.
scale: [f32; 3]Metres between samples along x, the height in metres along y, metres between samples along z (m_Scale).
heights: Vec<i16>The height samples, row z then column x, each 0 to MAX_HEIGHT.
holes: Option<Vec<u8>>One byte per cell, 0 a hole; None when none are stored.
layers: Vec<Option<ObjRef>>The splat layers (m_TerrainLayers), read with TerrainLayerData::read; None for a null pointer.
alphamaps: Vec<Option<ObjRef>>The splat weight textures (m_AlphaTextures), four layers’ weights each as RGBA.
alphamap_resolution: u32m_AlphamapResolution: the side of an alphamap in texels.
tree_prototypes: Vec<Option<ObjRef>>Each tree prototype’s prefab.
trees: Vec<TreeInstance>The tree instances.
Implementations§
Source§impl TerrainData
impl TerrainData
Sourcepub fn read(player: &Player, r: &ObjRef) -> Result<Self>
pub fn read(player: &Player, r: &ObjRef) -> Result<Self>
Read the TerrainData r of player, its heightmap as check_heightmap requires.
Trait Implementations§
Source§impl Clone for TerrainData
impl Clone for TerrainData
Source§impl Debug for TerrainData
impl Debug for TerrainData
Source§impl PartialEq for TerrainData
impl PartialEq for TerrainData
impl StructuralPartialEq for TerrainData
Auto Trait Implementations§
impl Freeze for TerrainData
impl RefUnwindSafe for TerrainData
impl Send for TerrainData
impl Sync for TerrainData
impl Unpin for TerrainData
impl UnsafeUnpin for TerrainData
impl UnwindSafe for TerrainData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more