pub struct ConvexPolyhedron { /* private fields */ }Expand description
A 3D convex polyhedron without degenerate faces.
A convex polyhedron is a 3D solid shape where all faces are flat polygons, all interior angles are less than 180 degrees, and any line segment drawn between two points inside the polyhedron stays entirely within it. Common examples include cubes, tetrahedra (pyramids), and prisms.
§What is a convex polyhedron?
In 3D space, a polyhedron is convex if:
- All faces are flat, convex polygons
- All dihedral angles (angles between adjacent faces) are less than or equal to 180 degrees
- The line segment between any two points inside the polyhedron lies entirely inside
- All vertices “bulge outward” - there are no indentations or concave regions
Examples of convex polyhedra: cube, tetrahedron, octahedron, rectangular prism, pyramid Examples of non-convex polyhedra: star shapes, torus, L-shapes, any shape with holes
§Use cases
Convex polyhedra are widely used in:
- Game development: Collision hulls for characters, vehicles, and complex objects
- Physics simulations: Rigid body dynamics (more efficient than arbitrary meshes)
- Robotics: Simplified robot link shapes, workspace boundaries
- Computer graphics: Level of detail (LOD) representations, occlusion culling
- Computational geometry: Building blocks for complex mesh operations
- 3D printing: Simplified collision detection for print validation
§Representation
This structure stores the complete topological information:
- Points: The 3D coordinates of all vertices
- Faces: Polygonal faces with their outward-pointing normals
- Edges: Connections between vertices, shared by exactly two faces
- Adjacency information: Which faces/edges connect to each vertex, and vice versa
This rich topology enables efficient collision detection algorithms like GJK, EPA, and SAT.
§Important: No degenerate faces
This structure ensures that there are no degenerate (flat or zero-area) faces. Coplanar adjacent triangles are automatically merged into larger polygonal faces during construction.
§Example: Creating a simple tetrahedron (pyramid)
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// Define the 4 vertices of a tetrahedron
let points = vec![
Point3::origin(), // base vertex 1
Point3::new(1.0, 0.0, 0.0), // base vertex 2
Point3::new(0.5, 1.0, 0.0), // base vertex 3
Point3::new(0.5, 0.5, 1.0), // apex
];
// Define the 4 triangular faces (indices into the points array)
let indices = vec![
[0u32, 1, 2], // base triangle
[0, 1, 3], // side 1
[1, 2, 3], // side 2
[2, 0, 3], // side 3
];
let tetrahedron = ConvexPolyhedron::from_convex_mesh(points, &indices)
.expect("Failed to create tetrahedron");
// A tetrahedron has 4 vertices and 4 faces
assert_eq!(tetrahedron.points().len(), 4);
assert_eq!(tetrahedron.faces().len(), 4);Implementations§
Source§impl ConvexPolyhedron
impl ConvexPolyhedron
Sourcepub fn bounding_sphere(&self, pos: &Isometry<f32>) -> BoundingSphere
pub fn bounding_sphere(&self, pos: &Isometry<f32>) -> BoundingSphere
Computes the world-space bounding sphere of this convex polyhedron, transformed by pos.
Sourcepub fn local_bounding_sphere(&self) -> BoundingSphere
pub fn local_bounding_sphere(&self) -> BoundingSphere
Computes the local-space bounding sphere of this convex polyhedron.
Source§impl ConvexPolyhedron
impl ConvexPolyhedron
Sourcepub fn from_convex_hull(points: &[Point<f32>]) -> Option<ConvexPolyhedron>
pub fn from_convex_hull(points: &[Point<f32>]) -> Option<ConvexPolyhedron>
Creates a new convex polyhedron from an arbitrary set of points by computing their convex hull.
This is the most flexible constructor - it automatically computes the convex hull of the given 3D points, which is the smallest convex polyhedron that contains all the input points. Think of it as shrink-wrapping the points with an elastic surface.
Use this when:
- You have an arbitrary collection of 3D points and want the convex boundary
- You’re not sure if your points form a convex shape
- You want to simplify a point cloud to its convex outer surface
- You need to create a collision hull from a detailed mesh
§Returns
Some(ConvexPolyhedron)if successfulNoneif the convex hull computation failed (e.g., all points are coplanar, collinear, or coincident, or if the mesh is not manifold)
§Example: Creating a convex hull from point cloud
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// Points defining a cube, plus some interior points
let points = vec![
Point3::origin(),
Point3::new(1.0, 0.0, 0.0),
Point3::new(1.0, 1.0, 0.0),
Point3::new(0.0, 1.0, 0.0),
Point3::new(0.0, 0.0, 1.0),
Point3::new(1.0, 0.0, 1.0),
Point3::new(1.0, 1.0, 1.0),
Point3::new(0.0, 1.0, 1.0),
Point3::new(0.5, 0.5, 0.5), // Interior point - will be excluded
];
let polyhedron = ConvexPolyhedron::from_convex_hull(&points)
.expect("Failed to create convex hull");
// The cube has 8 vertices (interior point excluded)
assert_eq!(polyhedron.points().len(), 8);
// And 6 faces (one per side of the cube)
assert_eq!(polyhedron.faces().len(), 6);§Example: Simplifying a complex mesh
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// Imagine these are vertices from a detailed character mesh
let detailed_mesh_vertices = vec![
Point3::new(-1.0, -1.0, -1.0),
Point3::new(1.0, -1.0, -1.0),
Point3::new(1.0, 1.0, -1.0),
Point3::new(-1.0, 1.0, -1.0),
Point3::new(-1.0, -1.0, 1.0),
Point3::new(1.0, -1.0, 1.0),
Point3::new(1.0, 1.0, 1.0),
Point3::new(-1.0, 1.0, 1.0),
// ... many more vertices in the original mesh
];
// Create a simplified collision hull
let collision_hull = ConvexPolyhedron::from_convex_hull(&detailed_mesh_vertices)
.expect("Failed to create collision hull");
// The hull is much simpler than the original mesh
println!("Simplified to {} vertices", collision_hull.points().len());Sourcepub fn from_convex_mesh(
points: Vec<Point<f32>>,
indices: &[[u32; 3]],
) -> Option<ConvexPolyhedron>
pub fn from_convex_mesh( points: Vec<Point<f32>>, indices: &[[u32; 3]], ) -> Option<ConvexPolyhedron>
Creates a new convex polyhedron from vertices and face indices, assuming the mesh is already convex.
This constructor is more efficient than from_convex_hull because it assumes the input
mesh is already convex and manifold. The convexity is not verified - if you pass a non-convex
mesh, the resulting shape may behave incorrectly in collision detection.
The method automatically:
- Merges coplanar adjacent triangular faces into larger polygonal faces
- Removes degenerate (zero-area) faces
- Builds complete topological connectivity information (vertices, edges, faces)
§Important requirements
The input mesh must be:
- Manifold: Each edge is shared by exactly 2 faces, no T-junctions, no holes
- Closed: The mesh completely encloses a volume with no gaps
- Convex (not enforced, but assumed): All faces bulge outward
- Valid: Faces use counter-clockwise winding when viewed from outside
§When to use this
Use this constructor when:
- You already have a triangulated convex mesh
- The mesh comes from a trusted source (e.g., generated procedurally)
- You want better performance by skipping convex hull computation
- You’re converting from another 3D format (OBJ, STL, etc.)
§Arguments
points- The vertex positions (3D coordinates)indices- The face triangles, each containing 3 indices into thepointsarray
§Returns
Some(ConvexPolyhedron)if successfulNoneif the mesh is not manifold, has T-junctions, is not closed, or has invalid topology
§Example: Creating a cube from vertices and faces
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// Define the 8 vertices of a unit cube
let vertices = vec![
Point3::origin(), // 0: bottom-left-front
Point3::new(1.0, 0.0, 0.0), // 1: bottom-right-front
Point3::new(1.0, 1.0, 0.0), // 2: bottom-right-back
Point3::new(0.0, 1.0, 0.0), // 3: bottom-left-back
Point3::new(0.0, 0.0, 1.0), // 4: top-left-front
Point3::new(1.0, 0.0, 1.0), // 5: top-right-front
Point3::new(1.0, 1.0, 1.0), // 6: top-right-back
Point3::new(0.0, 1.0, 1.0), // 7: top-left-back
];
// Define the faces as triangles (2 triangles per cube face)
let indices = vec![
// Bottom face (z = 0)
[0, 2, 1], [0, 3, 2],
// Top face (z = 1)
[4, 5, 6], [4, 6, 7],
// Front face (y = 0)
[0, 1, 5], [0, 5, 4],
// Back face (y = 1)
[2, 3, 7], [2, 7, 6],
// Left face (x = 0)
[0, 4, 7], [0, 7, 3],
// Right face (x = 1)
[1, 2, 6], [1, 6, 5],
];
let cube = ConvexPolyhedron::from_convex_mesh(vertices, &indices)
.expect("Failed to create cube");
// The cube has 8 vertices
assert_eq!(cube.points().len(), 8);
// The 12 triangles are merged into 6 square faces
assert_eq!(cube.faces().len(), 6);§Example: Creating a triangular prism
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// 6 vertices: 3 on bottom, 3 on top
let vertices = vec![
Point3::origin(),
Point3::new(1.0, 0.0, 0.0),
Point3::new(0.5, 1.0, 0.0),
Point3::new(0.0, 0.0, 2.0),
Point3::new(1.0, 0.0, 2.0),
Point3::new(0.5, 1.0, 2.0),
];
let indices = vec![
// Bottom triangle
[0, 2, 1],
// Top triangle
[3, 4, 5],
// Side faces (2 triangles each)
[0, 1, 4], [0, 4, 3],
[1, 2, 5], [1, 5, 4],
[2, 0, 3], [2, 3, 5],
];
let prism = ConvexPolyhedron::from_convex_mesh(vertices, &indices)
.expect("Failed to create prism");
assert_eq!(prism.points().len(), 6);
// 2 triangular faces + 3 rectangular faces = 5 faces
assert_eq!(prism.faces().len(), 5);Sourcepub fn check_geometry(&self)
pub fn check_geometry(&self)
Verify if this convex polyhedron is actually convex.
Sourcepub fn points(&self) -> &[Point<f32>] ⓘ
pub fn points(&self) -> &[Point<f32>] ⓘ
Returns the 3D coordinates of all vertices in this convex polyhedron.
Each point represents a corner of the polyhedron where three or more edges meet.
§Example
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
let points = vec![
Point3::origin(),
Point3::new(1.0, 0.0, 0.0),
Point3::new(0.5, 1.0, 0.0),
Point3::new(0.5, 0.5, 1.0),
];
let indices = vec![[0u32, 1, 2], [0, 1, 3], [1, 2, 3], [2, 0, 3]];
let tetrahedron = ConvexPolyhedron::from_convex_mesh(points, &indices).unwrap();
assert_eq!(tetrahedron.points().len(), 4);
assert_eq!(tetrahedron.points()[0], Point3::origin());Sourcepub fn vertices(&self) -> &[Vertex]
pub fn vertices(&self) -> &[Vertex]
Returns the topology information for all vertices.
Each Vertex contains indices into the adjacency arrays, telling you which
faces and edges are connected to that vertex. This is useful for advanced
topological queries and mesh processing algorithms.
Most users will want points() instead to get the 3D coordinates.
Sourcepub fn edges(&self) -> &[Edge]
pub fn edges(&self) -> &[Edge]
Returns the topology information for all edges.
Each Edge contains:
- The two vertex indices it connects
- The two face indices it borders
- The edge direction as a unit vector
This is useful for advanced geometric queries and rendering wireframes.
§Example
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
let points = vec![
Point3::origin(),
Point3::new(1.0, 0.0, 0.0),
Point3::new(0.5, 1.0, 0.0),
Point3::new(0.5, 0.5, 1.0),
];
let indices = vec![[0u32, 1, 2], [0, 1, 3], [1, 2, 3], [2, 0, 3]];
let tetrahedron = ConvexPolyhedron::from_convex_mesh(points, &indices).unwrap();
// A tetrahedron has 6 edges (4 vertices choose 2)
assert_eq!(tetrahedron.edges().len(), 6);
// Each edge connects two vertices
let edge = &tetrahedron.edges()[0];
println!("Edge connects vertices {} and {}", edge.vertices[0], edge.vertices[1]);Sourcepub fn faces(&self) -> &[Face]
pub fn faces(&self) -> &[Face]
Returns the topology information for all faces.
Each Face contains:
- Indices into the vertex and edge adjacency arrays
- The number of vertices/edges in the face (faces can be triangles, quads, or larger polygons)
- The outward-pointing unit normal vector
Faces are polygonal and can have 3 or more vertices. Adjacent coplanar triangles are automatically merged into larger polygonal faces.
§Example
use parry3d::shape::ConvexPolyhedron;
use nalgebra::Point3;
// Create a cube (8 vertices, 12 triangular input faces)
let vertices = vec![
Point3::origin(), Point3::new(1.0, 0.0, 0.0),
Point3::new(1.0, 1.0, 0.0), Point3::new(0.0, 1.0, 0.0),
Point3::new(0.0, 0.0, 1.0), Point3::new(1.0, 0.0, 1.0),
Point3::new(1.0, 1.0, 1.0), Point3::new(0.0, 1.0, 1.0),
];
let indices = vec![
[0, 2, 1], [0, 3, 2], [4, 5, 6], [4, 6, 7],
[0, 1, 5], [0, 5, 4], [2, 3, 7], [2, 7, 6],
[0, 4, 7], [0, 7, 3], [1, 2, 6], [1, 6, 5],
];
let cube = ConvexPolyhedron::from_convex_mesh(vertices, &indices).unwrap();
// The 12 triangles are merged into 6 square faces
assert_eq!(cube.faces().len(), 6);
// Each face has 4 vertices (it's a square)
assert_eq!(cube.faces()[0].num_vertices_or_edges, 4);Sourcepub fn vertices_adj_to_face(&self) -> &[u32]
pub fn vertices_adj_to_face(&self) -> &[u32]
The array containing the indices of the vertices adjacent to each face.
Sourcepub fn edges_adj_to_face(&self) -> &[u32]
pub fn edges_adj_to_face(&self) -> &[u32]
The array containing the indices of the edges adjacent to each face.
Sourcepub fn faces_adj_to_vertex(&self) -> &[u32]
pub fn faces_adj_to_vertex(&self) -> &[u32]
The array containing the indices of the faces adjacent to each vertex.
Sourcepub fn scaled(self, scale: &Vector<f32>) -> Option<Self>
pub fn scaled(self, scale: &Vector<f32>) -> Option<Self>
Computes a scaled version of this convex polyhedron.
This method scales the polyhedron by multiplying each vertex coordinate by the corresponding
component of the scale vector. This allows for non-uniform scaling (different scale factors
for x, y, and z axes).
The face normals and edge directions are also updated to reflect the scaling transformation.
§Returns
Some(ConvexPolyhedron)with the scaled shapeNoneif the scaling results in degenerate normals (e.g., if the scale factor along one axis is zero or nearly zero)
§Example: Uniform scaling
use parry3d::shape::ConvexPolyhedron;
use nalgebra::{Point3, Vector3};
let points = vec![
Point3::origin(),
Point3::new(1.0, 0.0, 0.0),
Point3::new(0.5, 1.0, 0.0),
Point3::new(0.5, 0.5, 1.0),
];
let indices = vec![[0u32, 1, 2], [0, 1, 3], [1, 2, 3], [2, 0, 3]];
let tetrahedron = ConvexPolyhedron::from_convex_mesh(points, &indices).unwrap();
// Scale uniformly by 2x
let scaled = tetrahedron.scaled(&Vector3::new(2.0, 2.0, 2.0))
.expect("Failed to scale");
// All coordinates are doubled
assert_eq!(scaled.points()[1], Point3::new(2.0, 0.0, 0.0));
assert_eq!(scaled.points()[3], Point3::new(1.0, 1.0, 2.0));§Example: Non-uniform scaling to create a rectangular prism
use parry3d::shape::ConvexPolyhedron;
use nalgebra::{Point3, Vector3};
// Start with a unit cube
let vertices = vec![
Point3::origin(), Point3::new(1.0, 0.0, 0.0),
Point3::new(1.0, 1.0, 0.0), Point3::new(0.0, 1.0, 0.0),
Point3::new(0.0, 0.0, 1.0), Point3::new(1.0, 0.0, 1.0),
Point3::new(1.0, 1.0, 1.0), Point3::new(0.0, 1.0, 1.0),
];
let indices = vec![
[0, 2, 1], [0, 3, 2], [4, 5, 6], [4, 6, 7],
[0, 1, 5], [0, 5, 4], [2, 3, 7], [2, 7, 6],
[0, 4, 7], [0, 7, 3], [1, 2, 6], [1, 6, 5],
];
let cube = ConvexPolyhedron::from_convex_mesh(vertices, &indices).unwrap();
// Scale to make it wider (3x), deeper (2x), and taller (4x)
let box_shape = cube.scaled(&Vector3::new(3.0, 2.0, 4.0))
.expect("Failed to scale");
assert_eq!(box_shape.points()[6], Point3::new(3.0, 2.0, 4.0));Trait Implementations§
Source§impl Clone for ConvexPolyhedron
impl Clone for ConvexPolyhedron
Source§fn clone(&self) -> ConvexPolyhedron
fn clone(&self) -> ConvexPolyhedron
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConvexPolyhedron
impl Debug for ConvexPolyhedron
Source§impl PartialEq for ConvexPolyhedron
impl PartialEq for ConvexPolyhedron
Source§impl PointQuery for ConvexPolyhedron
impl PointQuery for ConvexPolyhedron
Source§fn project_local_point(
&self,
point: &Point<f32>,
solid: bool,
) -> PointProjection
fn project_local_point( &self, point: &Point<f32>, solid: bool, ) -> PointProjection
self. Read moreSource§fn project_local_point_and_get_feature(
&self,
point: &Point<f32>,
) -> (PointProjection, FeatureId)
fn project_local_point_and_get_feature( &self, point: &Point<f32>, ) -> (PointProjection, FeatureId)
self and returns the id of the
feature the point was projected on.Source§fn project_local_point_with_max_dist(
&self,
pt: &Point<f32>,
solid: bool,
max_dist: f32,
) -> Option<PointProjection>
fn project_local_point_with_max_dist( &self, pt: &Point<f32>, solid: bool, max_dist: f32, ) -> Option<PointProjection>
Source§fn project_point_with_max_dist(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
max_dist: f32,
) -> Option<PointProjection>
fn project_point_with_max_dist( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, max_dist: f32, ) -> Option<PointProjection>
self transformed by m, unless the projection lies further than the given max distance.Source§fn distance_to_local_point(&self, pt: &Point<f32>, solid: bool) -> f32
fn distance_to_local_point(&self, pt: &Point<f32>, solid: bool) -> f32
self.Source§fn contains_local_point(&self, pt: &Point<f32>) -> bool
fn contains_local_point(&self, pt: &Point<f32>) -> bool
self.Source§fn project_point(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
) -> PointProjection
fn project_point( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, ) -> PointProjection
self transformed by m.Source§fn distance_to_point(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
solid: bool,
) -> f32
fn distance_to_point( &self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool, ) -> f32
self transformed by m.Source§fn project_point_and_get_feature(
&self,
m: &Isometry<f32>,
pt: &Point<f32>,
) -> (PointProjection, FeatureId)
fn project_point_and_get_feature( &self, m: &Isometry<f32>, pt: &Point<f32>, ) -> (PointProjection, FeatureId)
self transformed by m and returns the id of the
feature the point was projected on.Source§impl PolygonalFeatureMap for ConvexPolyhedron
impl PolygonalFeatureMap for ConvexPolyhedron
Source§fn local_support_feature(
&self,
dir: &Unit<Vector<f32>>,
out_feature: &mut PolygonalFeature,
)
fn local_support_feature( &self, dir: &Unit<Vector<f32>>, out_feature: &mut PolygonalFeature, )
self towards the dir.Source§fn is_convex_polyhedron(&self) -> bool
fn is_convex_polyhedron(&self) -> bool
ConvexPolyhedron?Source§impl RayCast for ConvexPolyhedron
impl RayCast for ConvexPolyhedron
Source§fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<RayIntersection>
fn cast_local_ray_and_get_normal( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>
Source§fn cast_local_ray(
&self,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<f32>
fn cast_local_ray( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>
Source§fn intersects_local_ray(&self, ray: &Ray, max_time_of_impact: f32) -> bool
fn intersects_local_ray(&self, ray: &Ray, max_time_of_impact: f32) -> bool
Source§fn cast_ray(
&self,
m: &Isometry<f32>,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<f32>
fn cast_ray( &self, m: &Isometry<f32>, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>
Source§fn cast_ray_and_get_normal(
&self,
m: &Isometry<f32>,
ray: &Ray,
max_time_of_impact: f32,
solid: bool,
) -> Option<RayIntersection>
fn cast_ray_and_get_normal( &self, m: &Isometry<f32>, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>
Source§impl Shape for ConvexPolyhedron
impl Shape for ConvexPolyhedron
Source§fn scale_dyn(
&self,
scale: &Vector<f32>,
_num_subdivisions: u32,
) -> Option<Box<dyn Shape>>
fn scale_dyn( &self, scale: &Vector<f32>, _num_subdivisions: u32, ) -> Option<Box<dyn Shape>>
scale into a boxed trait-object. Read moreSource§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.Source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
Source§fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
fn compute_aabb(&self, position: &Isometry<f32>) -> Aabb
Aabb of this shape with the given position.Source§fn mass_properties(&self, density: f32) -> MassProperties
fn mass_properties(&self, density: f32) -> MassProperties
Source§fn shape_type(&self) -> ShapeType
fn shape_type(&self) -> ShapeType
Source§fn as_typed_shape(&self) -> TypedShape<'_>
fn as_typed_shape(&self) -> TypedShape<'_>
fn ccd_thickness(&self) -> f32
fn ccd_angular_thickness(&self) -> f32
Source§fn as_support_map(&self) -> Option<&dyn SupportMap>
fn as_support_map(&self) -> Option<&dyn SupportMap>
Source§fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, f32)>
Source§fn feature_normal_at_point(
&self,
feature: FeatureId,
_point: &Point<f32>,
) -> Option<Unit<Vector<f32>>>
fn feature_normal_at_point( &self, feature: FeatureId, _point: &Point<f32>, ) -> Option<Unit<Vector<f32>>>
Source§fn clone_box(&self) -> Box<dyn Shape>
fn clone_box(&self) -> Box<dyn Shape>
clone_dynSource§fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn compute_bounding_sphere(&self, position: &Isometry<f32>) -> BoundingSphere
fn as_composite_shape(&self) -> Option<&dyn CompositeShape>
Source§impl SupportMap for ConvexPolyhedron
impl SupportMap for ConvexPolyhedron
Source§fn local_support_point(&self, dir: &Vector<f32>) -> Point<f32>
fn local_support_point(&self, dir: &Vector<f32>) -> Point<f32>
impl StructuralPartialEq for ConvexPolyhedron
Auto Trait Implementations§
impl Freeze for ConvexPolyhedron
impl RefUnwindSafe for ConvexPolyhedron
impl Send for ConvexPolyhedron
impl Sync for ConvexPolyhedron
impl Unpin for ConvexPolyhedron
impl UnwindSafe for ConvexPolyhedron
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.