Struct parry3d::bounding_volume::AABB [−][src]
Expand description
An Axis Aligned Bounding Box.
Fields
mins: Point<Real>
maxs: Point<Real>
Implementations
impl AABB
[src]
impl AABB
[src]pub const EDGES_VERTEX_IDS: [(usize, usize); 12]
[src]
pub const EDGES_VERTEX_IDS: [(usize, usize); 12]
[src]The vertex indices of each edge of this AABB.
This gives, for each edge of this AABB, the indices of its
vertices when taken from the self.vertices()
array.
Here is how the faces are numbered, assuming
a right-handed coordinate system:
y 3 - 2 | 7 − 6 | ___ x | | 1 (the zero is bellow 3 and on the left of 1, hidden by the 4-5-6-7 face.) / 4 - 5 z
pub const FACES_VERTEX_IDS: [(usize, usize, usize, usize); 6]
[src]
pub const FACES_VERTEX_IDS: [(usize, usize, usize, usize); 6]
[src]The vertex indices of each face of this AABB.
This gives, for each face of this AABB, the indices of its
vertices when taken from the self.vertices()
array.
Here is how the faces are numbered, assuming
a right-handed coordinate system:
y 3 - 2 | 7 − 6 | ___ x | | 1 (the zero is bellow 3 and on the left of 1, hidden by the 4-5-6-7 face.) / 4 - 5 z
pub fn new(mins: Point<Real>, maxs: Point<Real>) -> 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]
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]
pub fn from_half_extents(
center: Point<Real>,
half_extents: Vector<Real>
) -> Self
[src]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]
pub fn from_points<'a, I>(pts: I) -> Self where
I: IntoIterator<Item = &'a Point<Real>>,
[src]Creates a new AABB from a set of points.
pub fn half_extents(&self) -> Vector<Real>
[src]
pub fn half_extents(&self) -> Vector<Real>
[src]The half extents of this AABB.
pub fn take_point(&mut self, pt: Point<Real>)
[src]
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]
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]
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 split_at_center(&self) -> [AABB; 8]
[src]
pub fn split_at_center(&self) -> [AABB; 8]
[src]Splits this AABB at its center, into height parts (as in an octree).
impl AABB
[src]
impl AABB
[src]pub fn clip_segment(
&self,
pa: &Point<Real>,
pb: &Point<Real>
) -> Option<Segment>
[src]
pub fn clip_segment(
&self,
pa: &Point<Real>,
pb: &Point<Real>
) -> Option<Segment>
[src]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]
pub fn clip_line_parameters(
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<(Real, Real)>
[src]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]
pub fn clip_line(
&self,
orig: &Point<Real>,
dir: &Vector<Real>
) -> Option<Segment>
[src]Computes the intersection segment between a line 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]
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]
pub fn clip_polygon_with_workspace(
&self,
points: &mut Vec<Point<Real>>,
workspace: &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.
Trait Implementations
impl BoundingVolume for AABB
[src]
impl BoundingVolume for AABB
[src]fn center(&self) -> Point<Real>
[src]
fn center(&self) -> Point<Real>
[src]Returns a point inside of this bounding volume. This is ideally its center.
fn intersects(&self, other: &AABB) -> bool
[src]
fn intersects(&self, other: &AABB) -> bool
[src]Checks if this bounding volume intersect with another one.
fn merge(&mut self, other: &AABB)
[src]
fn merge(&mut self, other: &AABB)
[src]Merges this bounding volume with another one. The merge is done in-place.
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(&self, pt: &Point<Real>, solid: bool) -> PointProjection
[src]Projects a point on self
. Read more
fn project_local_point_and_get_feature(
&self,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
[src]
fn project_local_point_and_get_feature(
&self,
pt: &Point<Real>
) -> (PointProjection, FeatureId)
[src]Projects a point on the boundary of self
and returns the id of the
feature the point was projected on. Read more
fn distance_to_local_point(&self, pt: &Point<Real>, solid: bool) -> Real
[src]
fn distance_to_local_point(&self, pt: &Point<Real>, solid: bool) -> Real
[src]Computes the minimal distance between a point and self
.
fn contains_local_point(&self, pt: &Point<Real>) -> bool
[src]
fn contains_local_point(&self, pt: &Point<Real>) -> bool
[src]Tests if the given point is inside of self
.
fn project_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> PointProjection
[src]
fn project_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> PointProjection
[src]Projects a point on self
transformed by m
.
fn distance_to_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> Real
[src]
fn distance_to_point(
&self,
m: &Isometry<Real>,
pt: &Point<Real>,
solid: bool
) -> Real
[src]Computes the minimal distance between a point and self
transformed by m
.
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(&self, ray: &Ray, max_toi: Real, solid: bool) -> Option<Real>
[src]Computes the time of impact between this transform shape and a ray.
fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]
fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]Computes the time of impact, and normal between this transformed shape and a ray.
fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool
[src]
fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool
[src]Tests whether a ray intersects this transformed shape.
fn cast_ray(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<Real>
[src]
fn cast_ray(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<Real>
[src]Computes the time of impact between this transform shape and a ray.
fn cast_ray_and_get_normal(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]
fn cast_ray_and_get_normal(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
[src]Computes the time of impact, and normal between this transformed shape and a ray.
impl Copy for AABB
[src]
impl StructuralPartialEq for AABB
[src]
Auto Trait Implementations
impl RefUnwindSafe for AABB
impl Send for AABB
impl Sync for AABB
impl Unpin for AABB
impl UnwindSafe for AABB
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
[src]
impl<T> Downcast for T where
T: Any,
[src]pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
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 to_subset(&self) -> Option<SS>
[src]The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
[src]
pub fn is_in_subset(&self) -> bool
[src]Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
[src]
pub fn from_subset(element: &SS) -> SP
[src]The inclusion map: converts self
to the equivalent element of its superset.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more