Struct ncollide2d::shape::ConvexPolygonalFeature [−][src]
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], }
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.
Methods
impl<N: Real> ConvexPolygonalFeature<N>
[src]
impl<N: Real> ConvexPolygonalFeature<N>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new empty convex polygonal faces.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Removes all the vertices, normals, and feature IDs of this feature.
pub fn transform_by(&mut self, m: &Isometry<N>)
[src]
pub fn transform_by(&mut self, m: &Isometry<N>)
Transforms all the vertices and normal of this feature by the given isometry.
pub fn push(&mut self, pt: Point<N>, id: FeatureId)
[src]
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.
pub fn nvertices(&self) -> usize
[src]
pub fn nvertices(&self) -> usize
The number of vertices of this face.
pub fn vertices(&self) -> &[Point<N>]
[src]
pub fn vertices(&self) -> &[Point<N>]
The vertices of this convex polygonal face.
pub fn set_normal(&mut self, normal: Unit<Vector<N>>)
[src]
pub fn set_normal(&mut self, normal: Unit<Vector<N>>)
Sets the outward normal of this convex polygonal face.
pub fn set_feature_id(&mut self, id: FeatureId)
[src]
pub fn set_feature_id(&mut self, id: FeatureId)
Sets the identifier of the feature represented by this convex polygon.
pub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
[src]
pub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
Projects a point on this feature.
Trait Implementations
impl<N: Clone + Real> Clone for ConvexPolygonalFeature<N>
[src]
impl<N: Clone + Real> Clone for ConvexPolygonalFeature<N>
fn clone(&self) -> ConvexPolygonalFeature<N>
[src]
fn clone(&self) -> ConvexPolygonalFeature<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: Debug + Real> Debug for ConvexPolygonalFeature<N>
[src]
impl<N: Debug + Real> Debug for ConvexPolygonalFeature<N>
Auto Trait Implementations
impl<N> Send for ConvexPolygonalFeature<N>
impl<N> Send for ConvexPolygonalFeature<N>
impl<N> Sync for ConvexPolygonalFeature<N>
impl<N> Sync for ConvexPolygonalFeature<N>