Struct rhusics::collide3d::ConvexPolyhedron
[−]
[src]
pub struct ConvexPolyhedron<S> where
S: BaseFloat, { /* fields omitted */ }
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.
Methods
impl<S> ConvexPolyhedron<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn new(vertices: Vec<Point3<S>>) -> ConvexPolyhedron<S>
[src]
Create a new convex polyhedron from the given vertices.
fn new_with_faces(
vertices: Vec<Point3<S>>,
faces: Vec<(usize, usize, usize)>
) -> ConvexPolyhedron<S>
[src]
vertices: Vec<Point3<S>>,
faces: Vec<(usize, usize, usize)>
) -> ConvexPolyhedron<S>
Create a new convex polyhedron from the given vertices and faces.
fn new_with_faces_dedup(
vertices: Vec<Point3<S>>,
faces: Vec<(usize, usize, usize)>
) -> ConvexPolyhedron<S>
[src]
vertices: Vec<Point3<S>>,
faces: Vec<(usize, usize, usize)>
) -> ConvexPolyhedron<S>
Create a new convex polyhedron from the given vertices and faces. Will remove any duplicate vertices.
Trait Implementations
impl<S> Clone for ConvexPolyhedron<S> where
S: Clone + BaseFloat,
[src]
S: Clone + BaseFloat,
fn clone(&self) -> ConvexPolyhedron<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S> SupportFunction for ConvexPolyhedron<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Point = Point3<S>
Point type
fn support_point<T>(&self, direction: &Vector3<S>, transform: &T) -> Point3<S> where
T: Transform<Point3<S>>,
[src]
T: Transform<Point3<S>>,
Get the support point on the shape in a given direction. Read more
impl<S> HasAabb for ConvexPolyhedron<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Aabb = Aabb3<S>
Bounding box type
fn get_bound(&self) -> Aabb3<S>
[src]
Get the bounding box of the primitive in local space coordinates.
impl<S> PartialEq<ConvexPolyhedron<S>> for ConvexPolyhedron<S> where
S: PartialEq<S> + BaseFloat,
[src]
S: PartialEq<S> + BaseFloat,
fn eq(&self, __arg_0: &ConvexPolyhedron<S>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ConvexPolyhedron<S>) -> bool
[src]
This method tests for !=
.
impl<S> Debug for ConvexPolyhedron<S> where
S: Debug + BaseFloat,
[src]
S: Debug + BaseFloat,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl<S> Discrete<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S> where
S: BaseFloat,
[src]
S: BaseFloat,
TODO: better algorithm for finding faces to intersect with?
impl<S> Continuous<Ray<S, Point3<S>, Vector3<S>>> for ConvexPolyhedron<S> where
S: BaseFloat,
[src]
S: BaseFloat,