Struct rhusics_core::collide3d::ConvexPolyhedron
source · pub struct ConvexPolyhedron<S>where
S: BaseFloat,{ /* private fields */ }
Expand description
Convex polyhedron primitive.
Can contain any number of vertices, but a high number of vertices will affect performance of course. It is recommended for high vertex counts, to also provide the faces, this will cause the support function to use hill climbing on a half edge structure, resulting in better performance. The breakpoint is around 250 vertices, but the face version is only marginally slower on lower vertex counts (about 1-2%), while for higher vertex counts it’s about 2-5 times faster.
Implementations
sourceimpl<S> ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> ConvexPolyhedron<S>where
S: BaseFloat,
sourcepub fn new(vertices: Vec<Point3<S>, Global>) -> ConvexPolyhedron<S>
pub fn new(vertices: Vec<Point3<S>, Global>) -> ConvexPolyhedron<S>
Create a new convex polyhedron from the given vertices.
sourcepub fn new_with_faces(
vertices: Vec<Point3<S>, Global>,
faces: Vec<(usize, usize, usize), Global>
) -> ConvexPolyhedron<S>
pub fn new_with_faces(
vertices: Vec<Point3<S>, Global>,
faces: Vec<(usize, usize, usize), Global>
) -> ConvexPolyhedron<S>
Create a new convex polyhedron from the given vertices and faces.
sourcepub fn new_with_faces_dedup(
vertices: Vec<Point3<S>, Global>,
faces: Vec<(usize, usize, usize), Global>
) -> ConvexPolyhedron<S>
pub fn new_with_faces_dedup(
vertices: Vec<Point3<S>, Global>,
faces: Vec<(usize, usize, usize), Global>
) -> ConvexPolyhedron<S>
Create a new convex polyhedron from the given vertices and faces. Will remove any duplicate vertices.
sourcepub fn faces_iter(&self) -> FaceIterator<'_, S>
pub fn faces_iter(&self) -> FaceIterator<'_, S>
Return an iterator that will yield tuples of the 3 vertices of each face
Trait Implementations
sourceimpl<S> Clone for ConvexPolyhedron<S>where
S: Clone + BaseFloat,
impl<S> Clone for ConvexPolyhedron<S>where
S: Clone + BaseFloat,
sourcefn clone(&self) -> ConvexPolyhedron<S>
fn clone(&self) -> ConvexPolyhedron<S>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<S> ComputeBound<Aabb3<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> ComputeBound<Aabb3<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
sourcefn compute_bound(&self) -> Aabb3<S>
fn compute_bound(&self) -> Aabb3<S>
sourceimpl<S> ComputeBound<Sphere<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
sourcefn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
sourceimpl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S>where
S: BaseFloat,
sourceimpl<S> Debug for ConvexPolyhedron<S>where
S: Debug + BaseFloat,
impl<S> Debug for ConvexPolyhedron<S>where
S: Debug + BaseFloat,
sourceimpl<'de, S> Deserialize<'de> for ConvexPolyhedron<S>where
S: BaseFloat + Deserialize<'de>,
impl<'de, S> Deserialize<'de> for ConvexPolyhedron<S>where
S: BaseFloat + Deserialize<'de>,
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<ConvexPolyhedron<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConvexPolyhedron<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S>where
S: BaseFloat,
TODO: better algorithm for finding faces to intersect with?