pub struct BlockLocalAabb {
min_x: f64,
min_y: f64,
min_z: f64,
max_x: f64,
max_y: f64,
max_z: f64,
}Expand description
Block-local axis-aligned box used by voxel shapes.
Coordinates are relative to a block position. Vanilla block shapes are usually in 0.0..=1.0 space, but some shapes extend outside that range.
Fields§
§min_x: f64§min_y: f64§min_z: f64§max_x: f64§max_y: f64§max_z: f64Implementations§
Source§impl BlockLocalAabb
impl BlockLocalAabb
Sourcepub const FULL_BLOCK: Self
pub const FULL_BLOCK: Self
A full block from (0, 0, 0) to (1, 1, 1).
Sourcepub const fn new(
min_x: f64,
min_y: f64,
min_z: f64,
max_x: f64,
max_y: f64,
max_z: f64,
) -> Self
pub const fn new( min_x: f64, min_y: f64, min_z: f64, max_x: f64, max_y: f64, max_z: f64, ) -> Self
Creates a block-local AABB and normalizes endpoint order like vanilla
AABB.
Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
Returns true when this box has no positive volume on at least one axis.
Sourcepub fn move_by(self, dx: f64, dy: f64, dz: f64) -> Self
pub fn move_by(self, dx: f64, dy: f64, dz: f64) -> Self
Returns this box translated by the given delta.
Sourcepub fn inflate(self, amount: f64) -> Self
pub fn inflate(self, amount: f64) -> Self
Returns this box expanded by amount in every direction.
Sourcepub fn inflate_xyz(self, x: f64, y: f64, z: f64) -> Self
pub fn inflate_xyz(self, x: f64, y: f64, z: f64) -> Self
Returns this box expanded independently on each axis.
Sourcepub fn deflate(self, amount: f64) -> Self
pub fn deflate(self, amount: f64) -> Self
Returns this box shrunk by amount in every direction.
Sourcepub fn intersects(self, other: Self) -> bool
pub fn intersects(self, other: Self) -> bool
Returns true if this box intersects other.
Trait Implementations§
Source§impl Clone for BlockLocalAabb
impl Clone for BlockLocalAabb
Source§fn clone(&self) -> BlockLocalAabb
fn clone(&self) -> BlockLocalAabb
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BlockLocalAabb
Source§impl Debug for BlockLocalAabb
impl Debug for BlockLocalAabb
Source§impl PartialEq for BlockLocalAabb
impl PartialEq for BlockLocalAabb
Source§fn eq(&self, other: &BlockLocalAabb) -> bool
fn eq(&self, other: &BlockLocalAabb) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BlockLocalAabb
Auto Trait Implementations§
impl Freeze for BlockLocalAabb
impl RefUnwindSafe for BlockLocalAabb
impl Send for BlockLocalAabb
impl Sync for BlockLocalAabb
impl Unpin for BlockLocalAabb
impl UnsafeUnpin for BlockLocalAabb
impl UnwindSafe for BlockLocalAabb
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