pub trait ConvexPolyhedron<N: RealField + Copy>: SupportMap<N> {
// Required methods
fn vertex(&self, id: FeatureId) -> Point<N>;
fn face(&self, id: FeatureId, face: &mut ConvexPolygonalFeature<N>);
fn edge(&self, id: FeatureId) -> (Point<N>, Point<N>, FeatureId, FeatureId);
fn feature_normal(&self, feature: FeatureId) -> Unit<Vector<N>>;
fn support_face_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
out: &mut ConvexPolygonalFeature<N>,
);
fn support_feature_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
_angle: N,
out: &mut ConvexPolygonalFeature<N>,
);
fn support_feature_id_toward(
&self,
local_dir: &Unit<Vector<N>>,
) -> FeatureId;
}
Expand description
Trait implemented by all convex polyhedron.
Required Methods§
Sourcefn vertex(&self, id: FeatureId) -> Point<N>
fn vertex(&self, id: FeatureId) -> Point<N>
Gets the specified vertex in the shape local-space.
Sourcefn face(&self, id: FeatureId, face: &mut ConvexPolygonalFeature<N>)
fn face(&self, id: FeatureId, face: &mut ConvexPolygonalFeature<N>)
Fill face
with the geometric description of the specified face, in the shape’s local-space.
Sourcefn edge(&self, id: FeatureId) -> (Point<N>, Point<N>, FeatureId, FeatureId)
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.
Sourcefn feature_normal(&self, feature: FeatureId) -> Unit<Vector<N>>
fn feature_normal(&self, feature: FeatureId) -> Unit<Vector<N>>
Returns any normal from the normal cone of the given feature.
Sourcefn support_face_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
out: &mut ConvexPolygonalFeature<N>,
)
fn support_face_toward( &self, transform: &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
.
Sourcefn support_feature_toward(
&self,
transform: &Isometry<N>,
dir: &Unit<Vector<N>>,
_angle: N,
out: &mut ConvexPolygonalFeature<N>,
)
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
.
Sourcefn support_feature_id_toward(&self, local_dir: &Unit<Vector<N>>) -> FeatureId
fn support_feature_id_toward(&self, local_dir: &Unit<Vector<N>>) -> FeatureId
Retrieve the identifier of the feature which normal cone contains dir
.