Struct parry2d_f64::bounding_volume::AABB [−][src]
An Axis Aligned Bounding Box.
Fields
mins: Point<Real>
maxs: Point<Real>
Implementations
impl AABB
[src]
impl AABB
[src]pub fn new(mins: Point<Real>, maxs: Point<Real>) -> AABB
[src]
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
.
pub fn new_invalid() -> Self
[src]
Creates an invalid AABB with mins
components set to Real::max_values
and maxs
components set to -Real::max_values
.
This is often used as the initial values of some AABB merging algorithms.
pub fn from_half_extents(
center: Point<Real>,
half_extents: Vector<Real>
) -> Self
[src]
center: Point<Real>,
half_extents: Vector<Real>
) -> Self
Creates a new AABB from its center and its half-extents.
pub fn from_points<'a, I>(pts: I) -> Self where
I: IntoIterator<Item = &'a Point<Real>>,
[src]
I: IntoIterator<Item = &'a Point<Real>>,
Creates a new AABB from a set of points.
pub fn center(&self) -> Point<Real>
[src]
The center of this AABB.
pub fn half_extents(&self) -> Vector<Real>
[src]
The half extents of this AABB.
pub fn extents(&self) -> Vector<Real>
[src]
The extents of this AABB.
pub fn take_point(&mut self, pt: Point<Real>)
[src]
Enlarges this AABB so it also contains the point pt
.
pub fn transform_by(&self, m: &Isometry<Real>) -> Self
[src]
Computes the AABB bounding self
transformed by m
.
pub fn bounding_sphere(&self) -> BoundingSphere
[src]
The smallest bounding sphere containing this AABB.
pub fn contains_local_point(&self, point: &Point<Real>) -> bool
[src]
pub fn vertices(&self) -> [Point<Real>; 4]
[src]
Computes the vertices of this AABB.
pub fn split_at_center(&self) -> [AABB; 4]
[src]
Splits this AABB at its center, into four parts (as in a quad-tree).
impl AABB
[src]
impl AABB
[src]pub fn clip_segment(
&self,
pa: &Point<Real>,
pb: &Point<Real>
) -> Option<Segment>
[src]
&self,
pa: &Point<Real>,
pb: &Point<Real>
) -> Option<Segment>
Computes the intersection of a segment with this AABB.
Returns None
if there is no intersection.
pub fn clip_line_parameters(
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<(Real, Real)>
[src]
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<(Real, Real)>
Computes the parameters of the two intersection points between a line and this AABB.
The parameters are such that the point are given by orig + dir * parameter
.
Returns None
if there is no intersection.
pub fn clip_line(
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<Segment>
[src]
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<Segment>
Computes the intersection segment between a line and this AABB.
Returns None
if there is no intersection.
pub fn clip_ray_parameters(&self, ray: &Ray) -> Option<(Real, Real)>
[src]
Computes the parameters of the two intersection points between a ray and this AABB.
The parameters are such that the point are given by ray.orig + ray.dir * parameter
.
Returns None
if there is no intersection.
pub fn clip_ray(&self, ray: &Ray) -> Option<Segment>
[src]
Computes the intersection segment between a ray and this AABB.
Returns None
if there is no intersection.
impl AABB
[src]
impl AABB
[src]pub fn clip_polygon(&self, points: &mut Vec<Point<Real>>)
[src]
Computes the intersections between this AABB and the given polygon.
The results is written into points
directly. The input points are
assumed to form a convex polygon where all points lie on the same plane.
In order to avoid internal allocations, uses self.clip_polygon_with_workspace
instead.
pub fn clip_polygon_with_workspace(
&self,
points: &mut Vec<Point<Real>>,
workspace: &mut Vec<Point<Real>>
)
[src]
&self,
points: &mut Vec<Point<Real>>,
workspace: &mut Vec<Point<Real>>
)
Computes the intersections between this AABB and the given polygon.
The results is written into points
directly. The input points are
assumed to form a convex polygon where all points lie on the same plane.
Trait Implementations
impl BoundingVolume for AABB
[src]
impl BoundingVolume for AABB
[src]fn center(&self) -> Point<Real>
[src]
fn intersects(&self, other: &AABB) -> bool
[src]
fn contains(&self, other: &AABB) -> bool
[src]
fn merge(&mut self, other: &AABB)
[src]
fn merged(&self, other: &AABB) -> AABB
[src]
fn loosen(&mut self, amount: Real)
[src]
fn loosened(&self, amount: Real) -> AABB
[src]
fn tighten(&mut self, amount: Real)
[src]
fn tightened(&self, amount: Real) -> AABB
[src]
impl PointQuery for AABB
[src]
impl PointQuery for AABB
[src]fn project_local_point(&self, pt: &Point<Real>, solid: bool) -> PointProjection
[src]
fn project_local_point_and_get_feature(
&self,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
[src]
&self,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
fn distance_to_local_point(&self, pt: &Point<Real>, solid: bool) -> Real
[src]
fn contains_local_point(&self, pt: &Point<Real>) -> bool
[src]
fn project_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> PointProjection
[src]
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> PointProjection
fn distance_to_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> Real
[src]
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> Real
fn project_point_and_get_feature(
&self,
m: &Isometry<Real>,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
[src]
&self,
m: &Isometry<Real>,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
fn contains_point(&self, m: &Isometry<Real>, pt: &Point<Real>) -> bool
[src]
impl RayCast for AABB
[src]
impl RayCast for AABB
[src]fn cast_local_ray(&self, ray: &Ray, max_toi: Real, solid: bool) -> Option<Real>
[src]
fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]
&self,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool
[src]
fn cast_ray(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<Real>
[src]
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<Real>
fn cast_ray_and_get_normal(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
fn intersects_ray(&self, m: &Isometry<Real>, ray: &Ray, max_toi: Real) -> bool
[src]
impl StructuralPartialEq for AABB
[src]
impl StructuralPartialEq for AABB
[src]Auto Trait Implementations
impl RefUnwindSafe for AABB
impl RefUnwindSafe for AABB
impl UnwindSafe for AABB
impl UnwindSafe for AABB
Blanket Implementations
impl<T> CheckedAs for T
[src]
impl<T> CheckedAs for T
[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
T: CheckedCast<Dst>,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]pub fn lossy_into(self) -> Dst
[src]
impl<T> OverflowingAs for T
[src]
impl<T> OverflowingAs for T
[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
T: OverflowingCast<Dst>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
impl<T> SaturatingAs for T
[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
T: SaturatingCast<Dst>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> UnwrappedAs for T
[src]
impl<T> UnwrappedAs for T
[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
T: UnwrappedCast<Dst>,
impl<T> WrappingAs for T
[src]
impl<T> WrappingAs for T
[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
T: WrappingCast<Dst>,