#[non_exhaustive]pub struct WorldBlock {Show 21 fields
pub world_size_x: f32,
pub world_size_z: f32,
pub tile_width: f32,
pub tile_height: f32,
pub tiles_x: i32,
pub tiles_z: i32,
pub deep_sea_height: f32,
pub deep_water_depth: f32,
pub contour_max_error: f32,
pub obstacles: bool,
pub block_size: i32,
pub filter_isolated_islands: bool,
pub seed_position: [f32; 3],
pub stand_height: f32,
pub crouch_height: f32,
pub prone_height: f32,
pub diameter: f32,
pub max_step_height: f32,
pub max_slope: f32,
pub obstacles_raw: [u8; 4],
pub filter_raw: [u8; 4],
}Expand description
The 84-byte world block of the world params message (spec 3.4).
obstacles and filter_isolated_islands are one byte plus three pad bytes on the wire. The raw
four bytes are kept in obstacles_raw and filter_raw so that parsing and encoding round-trips.
Parsing sets the bool to raw[0] != 0. Encoding writes the raw bytes, but when the bool
disagrees with raw[0] (a value built from Default with only the bool set), byte 0 is
replaced by u8::from(bool).
Equality follows the wire: two blocks are equal when every other field is equal and their
effective flag bytes (the raw bytes with byte 0 forced to agree with the bool) are equal. So a
block built from Default with only obstacles = true set equals the block parsed from its own
encoding.
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.world_size_x: f32World size in x, metres.
world_size_z: f32World size in z, metres.
tile_width: f32Tile width, metres.
tile_height: f32Tile height (extent in z), metres.
tiles_x: i32Number of tiles in x.
tiles_z: i32Number of tiles in z.
deep_sea_height: f32Top of the sea box (a live tide value), metres.
deep_water_depth: f32Water deeper than this becomes deep water, metres.
contour_max_error: f32Contour simplification error, metres.
obstacles: boolExtract tree parts as cylinder obstacles.
block_size: i32Scheduler block edge length in tiles.
filter_isolated_islands: boolRun the island filter.
seed_position: [f32; 3]Seed position of the island filter.
stand_height: f32Agent stand height, metres.
crouch_height: f32Agent crouch height, metres.
prone_height: f32Agent prone height, metres.
diameter: f32Agent diameter, metres.
max_step_height: f32Agent maximum step height, metres.
max_slope: f32Agent maximum slope, degrees.
obstacles_raw: [u8; 4]The four wire bytes of obstacles (flag plus pad), kept for round-tripping.
filter_raw: [u8; 4]The four wire bytes of filter_isolated_islands (flag plus pad), kept for round-tripping.
Trait Implementations§
Source§impl Clone for WorldBlock
impl Clone for WorldBlock
Source§fn clone(&self) -> WorldBlock
fn clone(&self) -> WorldBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorldBlock
impl Debug for WorldBlock
Source§impl Default for WorldBlock
impl Default for WorldBlock
Source§fn default() -> WorldBlock
fn default() -> WorldBlock
Auto Trait Implementations§
impl Freeze for WorldBlock
impl RefUnwindSafe for WorldBlock
impl Send for WorldBlock
impl Sync for WorldBlock
impl Unpin for WorldBlock
impl UnsafeUnpin for WorldBlock
impl UnwindSafe for WorldBlock
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().