Struct ncollide2d::bounding_volume::AABB
source · pub struct AABB<N: Real> { /* private fields */ }
Expand description
An Axis Aligned Bounding Box.
Implementations§
source§impl<N: Real> AABB<N>
impl<N: Real> AABB<N>
sourcepub fn new(mins: Point<N>, maxs: Point<N>) -> AABB<N>
pub fn new(mins: Point<N>, maxs: Point<N>) -> AABB<N>
Creates a new AABB.
Arguments:
mins
- position of the point with the smallest coordinates.maxs
- position of the point with the highest coordinates. Each component ofmins
must be smaller than the related components ofmaxs
.
sourcepub fn mins(&self) -> &Point<N>
pub fn mins(&self) -> &Point<N>
Reference to the AABB point with the smallest components along each axis.
sourcepub fn maxs(&self) -> &Point<N>
pub fn maxs(&self) -> &Point<N>
Reference to the AABB point with the biggest components along each axis.
sourcepub fn half_extents(&self) -> Vector<N>
pub fn half_extents(&self) -> Vector<N>
The half extents of this AABB.
Trait Implementations§
source§impl<N: Real> BoundingVolume<N> for AABB<N>
impl<N: Real> BoundingVolume<N> for AABB<N>
source§fn center(&self) -> Point<N>
fn center(&self) -> Point<N>
Returns a point inside of this bounding volume. This is ideally its center.
source§fn intersects(&self, other: &AABB<N>) -> bool
fn intersects(&self, other: &AABB<N>) -> bool
Checks if this bounding volume intersect with another one.
source§fn contains(&self, other: &AABB<N>) -> bool
fn contains(&self, other: &AABB<N>) -> bool
Checks if this bounding volume contains another one.
source§fn merge(&mut self, other: &AABB<N>)
fn merge(&mut self, other: &AABB<N>)
Merges this bounding volume with another one. The merge is done in-place.
source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Ball<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Ball<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Compound<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Compound<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for ConvexPolygon<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for ConvexPolygon<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Cuboid<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Cuboid<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Plane<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Plane<N>
source§fn bounding_volume(&self, _: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, _: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Polyline<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Polyline<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for Segment<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Segment<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, AABB<N>> for dyn Shape<N>
impl<N: Real> HasBoundingVolume<N, AABB<N>> for dyn Shape<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of
self
transformed by m
.source§impl<N: PartialEq + Real> PartialEq<AABB<N>> for AABB<N>
impl<N: PartialEq + Real> PartialEq<AABB<N>> for AABB<N>
source§impl<N: Real> PointQuery<N> for AABB<N>
impl<N: Real> PointQuery<N> for AABB<N>
source§fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
Projects a point on
self
transformed by m
.source§fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
Projects a point on the boundary of
self
transformed by m
and retuns the id of the
feature the point was projected on. Read moresource§impl<N: Real> RayCast<N> for AABB<N>
impl<N: Real> RayCast<N> for AABB<N>
source§fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>
fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>
Computes the time of impact between this transform shape and a ray.
source§fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
Computes the time of impact, and normal between this transformed shape and a ray.
impl<N: Real> StructuralPartialEq for AABB<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for AABB<N>where
N: RefUnwindSafe,
impl<N> Send for AABB<N>
impl<N> Sync for AABB<N>
impl<N> Unpin for AABB<N>where
N: Unpin,
impl<N> UnwindSafe for AABB<N>where
N: UnwindSafe,
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.