Struct ncollide2d::shape::ConvexPolygonalFeature
source · pub struct ConvexPolygonalFeature<N: Real> {
pub vertices: [Point<N>; 2],
pub nvertices: usize,
pub normal: Option<Unit<Vector<N>>>,
pub feature_id: FeatureId,
pub vertices_id: [FeatureId; 2],
}
Expand description
A feature (face or vertex) of a 2D convex polygon.
Fields§
§vertices: [Point<N>; 2]
The vertices of this face.
nvertices: usize
Number of vertices in vertices
to be considered.
normal: Option<Unit<Vector<N>>>
The normal of this feature if it is an edge.
feature_id: FeatureId
The shape-dependent identifier of this feature.
vertices_id: [FeatureId; 2]
The shape-dependent indentifier of each vertex of this feature.
Implementations§
source§impl<N: Real> ConvexPolygonalFeature<N>
impl<N: Real> ConvexPolygonalFeature<N>
sourcepub fn transform_by(&mut self, m: &Isometry<N>)
pub fn transform_by(&mut self, m: &Isometry<N>)
Transforms all the vertices and normal of this feature by the given isometry.
sourcepub fn push(&mut self, pt: Point<N>, id: FeatureId)
pub fn push(&mut self, pt: Point<N>, id: FeatureId)
Adds a vertex to this face.
It is not checked whether pt
breaks the convexity of the polyhedral face.
sourcepub fn set_normal(&mut self, normal: Unit<Vector<N>>)
pub fn set_normal(&mut self, normal: Unit<Vector<N>>)
Sets the outward normal of this convex polygonal face.
sourcepub fn set_feature_id(&mut self, id: FeatureId)
pub fn set_feature_id(&mut self, id: FeatureId)
Sets the identifier of the feature represented by this convex polygon.
sourcepub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
pub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
Projects a point on this feature.
Trait Implementations§
Auto Trait Implementations§
impl<N> RefUnwindSafe for ConvexPolygonalFeature<N>where
N: RefUnwindSafe,
impl<N> Send for ConvexPolygonalFeature<N>
impl<N> Sync for ConvexPolygonalFeature<N>
impl<N> Unpin for ConvexPolygonalFeature<N>where
N: Unpin,
impl<N> UnwindSafe for ConvexPolygonalFeature<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.