Struct azalea_core::ChunkSectionPos
source · pub struct ChunkSectionPos {
pub x: i32,
pub y: i32,
pub z: i32,
}
Expand description
The coordinates of a chunk section in the world.
Fields§
§x: i32
§y: i32
§z: i32
Implementations§
source§impl ChunkSectionPos
impl ChunkSectionPos
pub fn new(x: i32, y: i32, z: i32) -> Self
sourcepub fn length_sqr(&self) -> i32
pub fn length_sqr(&self) -> i32
Get the distance of this vector to the origin by doing x^2 + y^2 + z^2
.
sourcepub fn distance_to_sqr(&self, other: &Self) -> i32
pub fn distance_to_sqr(&self, other: &Self) -> i32
Get the squared distance from this position to another position.
Equivalent to (self - other).length_sqr()
.
sourcepub fn down(&self, y: i32) -> Self
pub fn down(&self, y: i32) -> Self
Return a new instance of this position with the y coordinate decreased by the given number.
sourcepub fn up(&self, y: i32) -> Self
pub fn up(&self, y: i32) -> Self
Return a new instance of this position with the y coordinate increased by the given number.
pub fn dot(&self, other: Self) -> i32
source§impl ChunkSectionPos
impl ChunkSectionPos
pub fn block_to_section_coord(block: i32) -> i32
Trait Implementations§
source§impl Add<&ChunkSectionPos> for &ChunkSectionPos
impl Add<&ChunkSectionPos> for &ChunkSectionPos
source§impl Add<ChunkSectionBlockPos> for ChunkSectionPos
impl Add<ChunkSectionBlockPos> for ChunkSectionPos
source§impl Add<ChunkSectionPos> for ChunkSectionPos
impl Add<ChunkSectionPos> for ChunkSectionPos
source§impl AddAssign<ChunkSectionPos> for ChunkSectionPos
impl AddAssign<ChunkSectionPos> for ChunkSectionPos
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Clone for ChunkSectionPos
impl Clone for ChunkSectionPos
source§fn clone(&self) -> ChunkSectionPos
fn clone(&self) -> ChunkSectionPos
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChunkSectionPos
impl Debug for ChunkSectionPos
source§impl Default for ChunkSectionPos
impl Default for ChunkSectionPos
source§fn default() -> ChunkSectionPos
fn default() -> ChunkSectionPos
Returns the “default value” for a type. Read more
source§impl From<BlockPos> for ChunkSectionPos
impl From<BlockPos> for ChunkSectionPos
source§impl From<ChunkSectionPos> for ChunkPos
impl From<ChunkSectionPos> for ChunkPos
source§fn from(pos: ChunkSectionPos) -> Self
fn from(pos: ChunkSectionPos) -> Self
Converts to this type from the input type.
source§impl McBufReadable for ChunkSectionPos
impl McBufReadable for ChunkSectionPos
source§impl McBufWritable for ChunkSectionPos
impl McBufWritable for ChunkSectionPos
source§impl Mul<i32> for ChunkSectionPos
impl Mul<i32> for ChunkSectionPos
source§impl PartialEq<ChunkSectionPos> for ChunkSectionPos
impl PartialEq<ChunkSectionPos> for ChunkSectionPos
source§fn eq(&self, other: &ChunkSectionPos) -> bool
fn eq(&self, other: &ChunkSectionPos) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Rem<i32> for ChunkSectionPos
impl Rem<i32> for ChunkSectionPos
source§impl Sub<&ChunkSectionPos> for &ChunkSectionPos
impl Sub<&ChunkSectionPos> for &ChunkSectionPos
source§impl Sub<ChunkSectionPos> for ChunkSectionPos
impl Sub<ChunkSectionPos> for ChunkSectionPos
impl Copy for ChunkSectionPos
impl Eq for ChunkSectionPos
impl StructuralEq for ChunkSectionPos
impl StructuralPartialEq for ChunkSectionPos
Auto Trait Implementations§
impl RefUnwindSafe for ChunkSectionPos
impl Send for ChunkSectionPos
impl Sync for ChunkSectionPos
impl Unpin for ChunkSectionPos
impl UnwindSafe for ChunkSectionPos
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