pub struct Aabb {
pub min: Vec3,
pub max: Vec3,
}Expand description
An axis-aligned bounding box.
In other words, a rectangular prism with a starting and ending point.
Fields§
§min: Vec3§max: Vec3Implementations§
Source§impl Aabb
impl Aabb
pub fn contract(&self, amount: Vec3) -> Aabb
pub fn expand_towards(&self, other: Vec3) -> Aabb
pub fn inflate(&self, amount: Vec3) -> Aabb
pub fn inflate_all(&self, amount: 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, corner1: Vec3, corner2: Vec3) -> bool
pub fn contains(&self, point: Vec3) -> bool
pub fn size(&self) -> f64
pub fn get_size(&self, axis: Axis) -> f64
pub fn deflate(&self, amount: Vec3) -> Aabb
pub fn deflate_all(&self, amount: f64) -> Aabb
pub fn clip(&self, min: Vec3, max: Vec3) -> Option<Vec3>
pub fn clip_with_from_and_to( min: Vec3, max: Vec3, from: Vec3, to: Vec3, ) -> Option<Vec3>
pub fn clip_iterable( boxes: &[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
pub fn collided_along_vector(&self, vector: Vec3, boxes: &[Aabb]) -> bool
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 UnsafeUnpin 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