Struct vek::geom::repr_c::Aabb [−][src]
Expand description
Axis-aligned Bounding Box (3D), represented by min
and max
points.
N.B: You are responsible for ensuring that all respective elements of
min
are indeed less than or equal to those of max
.
The is_valid()
, make_valid()
and made_valid()
methods are designed to help you
with this.
Fields
min: Vec3<T>
Minimum coordinates of bounds.
max: Vec3<T>
Maximum coordinates of bounds.
Implementations
Is this bounding shape valid ?
True only if all elements of self.min
are less than or equal to those of self.max
.
Makes this bounding shape valid by swapping elements of self.min
with self.max
as needed.
Returns this bounding shape made valid by swapping elements of self.min
with self.max
as needed.
Creates a new bounding shape from a single point.
Converts this bounding shape to the matching rectangle representation.
Gets this bounding shape’s center.
Gets this bounding shape’s total size.
Gets this bounding shape’s half size.
Gets the smallest bounding shape that contains both this one and another.
Gets the largest bounding shape contained by both this one and another.
Sets this bounding shape to the union of itself with another.
Sets this bounding shape to the intersection of itself with another.
Gets a copy of this shape so that it contains the given point.
Expands this shape so that it contains the given point.
Does this bounding shape contain the given point ?
Does this bounding shape fully contain another ?
Does this bounding shape collide with another ?
pub fn collision_vector_with_aabb(self, other: Self) -> Vec3<T> where
T: Copy + PartialOrd + Sub<T, Output = T> + One + Add<T, Output = T> + Div<T, Output = T>,
pub fn collision_vector_with_aabb(self, other: Self) -> Vec3<T> where
T: Copy + PartialOrd + Sub<T, Output = T> + One + Add<T, Output = T> + Div<T, Output = T>,
Gets a vector that tells how much self
penetrates other
.
Project the given point into the bounding shape (equivalent to ‘snapping’ the point to the closest point in the bounding shape).
pub fn distance_to_point(self, p: Vec3<T>) -> T where
T: Clamp + Real + Add<T, Output = T> + RelativeEq,
pub fn distance_to_point(self, p: Vec3<T>) -> T where
T: Clamp + Real + Add<T, Output = T> + RelativeEq,
Get the smallest distance between the bounding shape and a point.
Splits this shape in two, by a straight plane along the
x
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
x
axis that is within this shape’s bounds.
Splits this shape in two, by a straight plane along the
y
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
y
axis that is within this shape’s bounds.
Splits this shape in two, by a straight plane along the
z
axis.
The returned tuple is (low, high)
.
Panics
sp
is assumed to be a position along the
z
axis that is within this shape’s bounds.
Returns this bounding shape, converted element-wise using the given closure.
Converts this rectangle to a rectangle of another type, using the as
conversion.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Aabb<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Aabb<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more