Struct ncollide3d::shape::ConvexPolygonalFeature [−][src]
pub struct ConvexPolygonalFeature<N: Real> { pub vertices: Vec<Point<N>>, pub edge_normals: Vec<Vector<N>>, pub normal: Option<Unit<Vector<N>>>, pub feature_id: FeatureId, pub vertices_id: Vec<FeatureId>, pub edges_id: Vec<FeatureId>, }
Represents a convex polygonal approximation of a face of a solid.
It is never checked if the vertices actually form a convex polygon. If they do not, results of any geometric query may end up being invalid.
Fields
vertices: Vec<Point<N>>
The vertices of this face.
edge_normals: Vec<Vector<N>>
The outward normal of the edges if it is a face.
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: Vec<FeatureId>
The shape-dependent indentifier of each vertex of this feature.
edges_id: Vec<FeatureId>
The shape-dependent indentifier of each edge 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 normals 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 nedges(&self) -> usize
[src]
pub fn nedges(&self) -> usize
The number of edges of this convex polygonal face.
pub fn edge(&self, edge_id: FeatureId) -> Option<Segment<N>>
[src]
pub fn edge(&self, edge_id: FeatureId) -> Option<Segment<N>>
Retrieves the edge with the given feature id.
pub fn push_scaled_edge_normal(&mut self, normal: Vector<N>)
[src]
pub fn push_scaled_edge_normal(&mut self, normal: Vector<N>)
Adds a scaled edge normal to this face.
pub fn push_edge_normal(&mut self, normal: Unit<Vector<N>>)
[src]
pub fn push_edge_normal(&mut self, normal: Unit<Vector<N>>)
Adds an edge normal to this face.
pub fn recompute_edge_normals(&mut self)
[src]
pub fn recompute_edge_normals(&mut self)
Automatically recomputes the scaled edge normals (3D only).
Panics if the ambient space is not 3D.
pub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
[src]
pub fn project_point(&self, pt: &Point<N>) -> Option<Contact<N>>
Transforms all the vertices of this feature by the given isometry.
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 push_edge_feature_id(&mut self, id: FeatureId)
[src]
pub fn push_edge_feature_id(&mut self, id: FeatureId)
Add the shape-dependent identifier of a edge of this feature (if it is a face).
pub fn set_feature_id(&mut self, id: FeatureId)
[src]
pub fn set_feature_id(&mut self, id: FeatureId)
Add the shape-dependent identifier of 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> where
N: Scalar,
impl<N> Send for ConvexPolygonalFeature<N> where
N: Scalar,
impl<N> Sync for ConvexPolygonalFeature<N> where
N: Scalar,
impl<N> Sync for ConvexPolygonalFeature<N> where
N: Scalar,