pub struct AABB {
pub min_x: f64,
pub min_y: f64,
pub min_z: f64,
pub max_x: f64,
pub max_y: f64,
pub max_z: f64,
}
Expand description
A rectangular prism with a starting and ending point.
Fields§
§min_x: f64
§min_y: f64
§min_z: f64
§max_x: f64
§max_y: f64
§max_z: f64
Implementations§
Source§impl AABB
impl AABB
pub fn contract(&self, x: f64, y: f64, z: f64) -> AABB
pub fn expand_towards(&self, other: &Vec3) -> AABB
pub fn inflate(&self, x: f64, y: f64, z: f64) -> AABB
pub fn intersect(&self, other: &AABB) -> AABB
pub fn minmax(&self, other: &AABB) -> AABB
pub fn move_relative(&self, delta: &Vec3) -> AABB
pub fn intersects_aabb(&self, other: &AABB) -> bool
pub fn intersects_vec3(&self, other: &Vec3, other2: &Vec3) -> bool
pub fn contains(&self, x: f64, y: f64, z: f64) -> bool
pub fn size(&self) -> f64
pub fn get_size(&self, axis: Axis) -> f64
pub fn deflate(&mut self, x: f64, y: f64, z: f64) -> AABB
pub fn clip(&self, min: &Vec3, max: &Vec3) -> Option<Vec3>
pub fn clip_iterable( boxes: &Vec<AABB>, from: &Vec3, to: &Vec3, pos: &BlockPos, ) -> Option<BlockHitResult>
pub fn has_nan(&self) -> bool
pub fn get_center(&self) -> Vec3
pub fn of_size(center: Vec3, dx: f64, dy: f64, dz: f64) -> AABB
pub fn max(&self, axis: &Axis) -> f64
pub fn min(&self, axis: &Axis) -> f64
Trait Implementations§
impl Copy for AABB
impl StructuralPartialEq for AABB
Auto Trait Implementations§
impl Freeze for AABB
impl RefUnwindSafe for AABB
impl Send for AABB
impl Sync for AABB
impl Unpin for AABB
impl UnwindSafe for AABB
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given [World
].