Struct ncollide2d::bounding_volume::BoundingSphere
source · pub struct BoundingSphere<N: Real> { /* private fields */ }
Expand description
A Bounding Sphere.
Implementations§
source§impl<N: Real> BoundingSphere<N>
impl<N: Real> BoundingSphere<N>
sourcepub fn new(center: Point<N>, radius: N) -> BoundingSphere<N>
pub fn new(center: Point<N>, radius: N) -> BoundingSphere<N>
Creates a new bounding sphere.
sourcepub fn transform_by(&self, m: &Isometry<N>) -> BoundingSphere<N>
pub fn transform_by(&self, m: &Isometry<N>) -> BoundingSphere<N>
Transforms this bounding sphere by m
.
Trait Implementations§
source§impl<N: Real> BoundingVolume<N> for BoundingSphere<N>
impl<N: Real> BoundingVolume<N> for BoundingSphere<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: &BoundingSphere<N>) -> bool
fn intersects(&self, other: &BoundingSphere<N>) -> bool
Checks if this bounding volume intersect with another one.
source§fn contains(&self, other: &BoundingSphere<N>) -> bool
fn contains(&self, other: &BoundingSphere<N>) -> bool
Checks if this bounding volume contains another one.
source§fn merge(&mut self, other: &BoundingSphere<N>)
fn merge(&mut self, other: &BoundingSphere<N>)
Merges this bounding volume with another one. The merge is done in-place.
source§fn merged(&self, other: &BoundingSphere<N>) -> BoundingSphere<N>
fn merged(&self, other: &BoundingSphere<N>) -> BoundingSphere<N>
Merges this bounding volume with another one.
source§fn loosened(&self, amount: N) -> BoundingSphere<N>
fn loosened(&self, amount: N) -> BoundingSphere<N>
Creates a new, enlarged version, of this bounding volume.
source§fn tightened(&self, amount: N) -> BoundingSphere<N>
fn tightened(&self, amount: N) -> BoundingSphere<N>
Creates a new, tightened version, of this bounding volume.
source§impl<N: Clone + Real> Clone for BoundingSphere<N>
impl<N: Clone + Real> Clone for BoundingSphere<N>
source§fn clone(&self) -> BoundingSphere<N>
fn clone(&self) -> BoundingSphere<N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Ball<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Ball<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Compound<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Compound<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for ConvexPolygon<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for ConvexPolygon<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Cuboid<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Cuboid<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Plane<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Plane<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Polyline<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Polyline<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Segment<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Segment<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for dyn Shape<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for dyn Shape<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: PartialEq + Real> PartialEq<BoundingSphere<N>> for BoundingSphere<N>
impl<N: PartialEq + Real> PartialEq<BoundingSphere<N>> for BoundingSphere<N>
source§fn eq(&self, other: &BoundingSphere<N>) -> bool
fn eq(&self, other: &BoundingSphere<N>) -> bool
source§impl<N: Real> PointQuery<N> for BoundingSphere<N>
impl<N: Real> PointQuery<N> for BoundingSphere<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 BoundingSphere<N>
impl<N: Real> RayCast<N> for BoundingSphere<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 BoundingSphere<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for BoundingSphere<N>where
N: RefUnwindSafe,
impl<N> Send for BoundingSphere<N>
impl<N> Sync for BoundingSphere<N>
impl<N> Unpin for BoundingSphere<N>where
N: Unpin,
impl<N> UnwindSafe for BoundingSphere<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.