#[non_exhaustive]pub struct TileData {
pub header: MeshHeader,
pub verts: Vec<[f32; 3]>,
pub polys: Vec<Poly>,
pub links: Vec<Link>,
pub detail_meshes: Vec<[u8; 12]>,
pub detail_verts: Vec<[f32; 3]>,
pub detail_tris: Vec<[u8; 4]>,
pub bv_tree: Vec<BvNode>,
pub off_mesh: Vec<OffMeshConnection>,
pub extra: Option<TileExtra>,
}Expand description
The sections of one Detour tile blob, in file order (spec 9.3).
The detail sections are kept as raw bytes so that foreign files round-trip; DayZ’s own tiles have
none. TileData::to_bytes derives the header counts from the lengths of the vectors.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header: MeshHeaderThe tile header.
verts: Vec<[f32; 3]>Vertices.
polys: Vec<Poly>Polygons.
links: Vec<Link>Links (maxLinkCount entries).
detail_meshes: Vec<[u8; 12]>Raw dtPolyDetail records (12 bytes each).
detail_verts: Vec<[f32; 3]>Detail vertices.
detail_tris: Vec<[u8; 4]>Raw detail triangles (4 bytes each).
bv_tree: Vec<BvNode>Bounding volume tree.
off_mesh: Vec<OffMeshConnection>Off-mesh connections.
extra: Option<TileExtra>The extra section: None when the blob has none (extraDataSize == 0), Some otherwise,
even when all three counts are zero (12 bytes).
Implementations§
Source§impl TileData
impl TileData
Sourcepub fn parse(blob: &[u8]) -> Result<Self>
pub fn parse(blob: &[u8]) -> Result<Self>
Parses one tile blob. Rejects a bad magic, a tile version other than NAVMESH_VERSION,
negative counts, section sizes that do not match the blob length (truncated, or trailing
bytes) and an extra section that disagrees with extraDataSize (spec 9.4). Every size is
computed with checked arithmetic and compared with the blob length before anything is
allocated.
§Errors
Returns an error for any of the rejections above.
Trait Implementations§
impl StructuralPartialEq for TileData
Auto Trait Implementations§
impl Freeze for TileData
impl RefUnwindSafe for TileData
impl Send for TileData
impl Sync for TileData
impl Unpin for TileData
impl UnsafeUnpin for TileData
impl UnwindSafe for TileData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().