Struct ncollide3d::shape::ConvexHull [−][src]
pub struct ConvexHull<N: Real> { /* fields omitted */ }
A convex polyhedron without degenerate faces.
Methods
impl<N: Real> ConvexHull<N>
[src]
impl<N: Real> ConvexHull<N>
pub fn try_from_points(points: &[Point<N>]) -> Option<ConvexHull<N>>
[src]
pub fn try_from_points(points: &[Point<N>]) -> Option<ConvexHull<N>>
Creates a new 2D convex polyhedron from an arbitrary set of points.
This explicitly computes the convex hull of the given set of points. Use
Returns None
if the convex hull computation failed.
pub fn try_new(
points: Vec<Point<N>>,
indices: &[usize]
) -> Option<ConvexHull<N>>
[src]
pub fn try_new(
points: Vec<Point<N>>,
indices: &[usize]
) -> Option<ConvexHull<N>>
Attempts to create a new solid assumed to be convex from the set of points and indices.
The given points and index informations are assumed to describe a convex polyhedron. It it is not, weird results may be produced.
Return
Retruns None
if:
- The given solid does not satisfy the euler characteristic.
- The given solid contains degenerate edges/triangles.
pub fn check_geometry(&self)
[src]
pub fn check_geometry(&self)
Verify if this convex polyhedron is actually convex.
pub fn points(&self) -> &[Point<N>]
[src]
pub fn points(&self) -> &[Point<N>]
The set of vertices of this convex polyhedron.
Trait Implementations
impl<N: Real> HasBoundingVolume<N, AABB<N>> for ConvexHull<N>
[src]
impl<N: Real> HasBoundingVolume<N, AABB<N>> for ConvexHull<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
[src]
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of self
transformed by m
.
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for ConvexHull<N>
[src]
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for ConvexHull<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
[src]
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of self
transformed by m
.
impl<N: Real> PointQuery<N> for ConvexHull<N>
[src]
impl<N: Real> PointQuery<N> for ConvexHull<N>
fn project_point(
&self,
m: &Isometry<N>,
point: &Point<N>,
solid: bool
) -> PointProjection<N>
[src]
fn project_point(
&self,
m: &Isometry<N>,
point: &Point<N>,
solid: bool
) -> PointProjection<N>
Projects a point on self
transformed by m
.
fn project_point_with_feature(
&self,
m: &Isometry<N>,
point: &Point<N>
) -> (PointProjection<N>, FeatureId)
[src]
fn project_point_with_feature(
&self,
m: &Isometry<N>,
point: &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 more
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
[src]
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
Computes the minimal distance between a point and self
transformed by m
.
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
[src]
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
Tests if the given point is inside of self
transformed by m
.
impl<N: Real> RayCast<N> for ConvexHull<N>
[src]
impl<N: Real> RayCast<N> for ConvexHull<N>
fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
[src]
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.
fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>
[src]
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.
fn toi_and_normal_and_uv_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
[src]
fn toi_and_normal_and_uv_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
Computes time of impact, normal, and texture coordinates (uv) between this transformed shape and a ray. Read more
fn intersects_ray(&self, m: &Isometry<N>, ray: &Ray<N>) -> bool
[src]
fn intersects_ray(&self, m: &Isometry<N>, ray: &Ray<N>) -> bool
Tests whether a ray intersects this transformed shape.
impl<N: PartialEq + Real> PartialEq for ConvexHull<N>
[src]
impl<N: PartialEq + Real> PartialEq for ConvexHull<N>
fn eq(&self, other: &ConvexHull<N>) -> bool
[src]
fn eq(&self, other: &ConvexHull<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ConvexHull<N>) -> bool
[src]
fn ne(&self, other: &ConvexHull<N>) -> bool
This method tests for !=
.
impl<N: Debug + Real> Debug for ConvexHull<N>
[src]
impl<N: Debug + Real> Debug for ConvexHull<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Clone + Real> Clone for ConvexHull<N>
[src]
impl<N: Clone + Real> Clone for ConvexHull<N>
fn clone(&self) -> ConvexHull<N>
[src]
fn clone(&self) -> ConvexHull<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Real> SupportMap<N> for ConvexHull<N>
[src]
impl<N: Real> SupportMap<N> for ConvexHull<N>
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
[src]
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
Evaluates the support function of the object. Read more
fn support_point_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
[src]
fn support_point_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
Same as self.support_point
except that dir
is normalized.
impl<N: Real> ConvexPolyhedron<N> for ConvexHull<N>
[src]
impl<N: Real> ConvexPolyhedron<N> for ConvexHull<N>
fn vertex(&self, id: FeatureId) -> Point<N>
[src]
fn vertex(&self, id: FeatureId) -> Point<N>
Gets the specified vertex in the shape local-space.
fn edge(&self, id: FeatureId) -> (Point<N>, Point<N>, FeatureId, FeatureId)
[src]
fn edge(&self, id: FeatureId) -> (Point<N>, Point<N>, FeatureId, FeatureId)
Get the specified edge's vertices (in the shape local-space) and the vertices' identifiers.
fn face(&self, id: FeatureId, out: &mut ConvexPolygonalFeature<N>)
[src]
fn face(&self, id: FeatureId, out: &mut ConvexPolygonalFeature<N>)
Fill face
with the geometric description of the specified face, in the shape's local-space.
fn normal_cone(&self, feature: FeatureId) -> PolyhedralCone<N>
[src]
fn normal_cone(&self, feature: FeatureId) -> PolyhedralCone<N>
Get the normal cone of the specified feature, in the shape's local-space.
fn support_face_toward(
&self,
m: &Isometry<N>,
dir: &Unit<Vector<N>>,
out: &mut ConvexPolygonalFeature<N>
)
[src]
fn support_face_toward(
&self,
m: &Isometry<N>,
dir: &Unit<Vector<N>>,
out: &mut ConvexPolygonalFeature<N>
)
Retrieve the face (in world-space) with a normal that maximizes the scalar product with dir
.
fn support_feature_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
_angle: N,
out: &mut ConvexPolygonalFeature<N>
)
[src]
fn support_feature_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
_angle: N,
out: &mut ConvexPolygonalFeature<N>
)
Retrieve the feature (in world-space) which normal cone contains dir
.
fn support_feature_id_toward(&self, local_dir: &Unit<Vector<N>>) -> FeatureId
[src]
fn support_feature_id_toward(&self, local_dir: &Unit<Vector<N>>) -> FeatureId
Retrieve the identifier of the feature which normal cone contains dir
.
impl<N: Real> Shape<N> for ConvexHull<N>
[src]
impl<N: Real> Shape<N> for ConvexHull<N>
fn aabb(&self, m: &Isometry<N>) -> AABB<N>
[src]
fn aabb(&self, m: &Isometry<N>) -> AABB<N>
The AABB of self
.
fn bounding_sphere(&self, m: &Isometry<N>) -> BoundingSphere<N>
[src]
fn bounding_sphere(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding sphere of self
.
fn as_ray_cast(&self) -> Option<&RayCast<N>>
[src]
fn as_ray_cast(&self) -> Option<&RayCast<N>>
The RayCast
implementation of self
.
fn as_point_query(&self) -> Option<&PointQuery<N>>
[src]
fn as_point_query(&self) -> Option<&PointQuery<N>>
The PointQuery
implementation of self
.
fn as_support_map(&self) -> Option<&SupportMap<N>>
[src]
fn as_support_map(&self) -> Option<&SupportMap<N>>
The support mapping of self
if applicable.
fn is_support_map(&self) -> bool
[src]
fn is_support_map(&self) -> bool
Whether self
uses a supportmapping-based representation.
fn as_convex_polyhedron(&self) -> Option<&ConvexPolyhedron<N>>
[src]
fn as_convex_polyhedron(&self) -> Option<&ConvexPolyhedron<N>>
The convex polyhedron representation of self
if applicable.
fn is_convex_polyhedron(&self) -> bool
[src]
fn is_convex_polyhedron(&self) -> bool
Whether self
uses a conve polyhedron representation.
fn subshape_transform(&self, _: usize) -> Option<Isometry<N>>
[src]
fn subshape_transform(&self, _: usize) -> Option<Isometry<N>>
The transform of a specific subshape. Read more
fn as_composite_shape(&self) -> Option<&CompositeShape<N>>
[src]
fn as_composite_shape(&self) -> Option<&CompositeShape<N>>
The composite shape representation of self
if applicable.
fn is_composite_shape(&self) -> bool
[src]
fn is_composite_shape(&self) -> bool
Whether self
uses a composite shape-based representation.
Auto Trait Implementations
impl<N> Send for ConvexHull<N>
impl<N> Send for ConvexHull<N>
impl<N> Sync for ConvexHull<N>
impl<N> Sync for ConvexHull<N>