Add 3D convex decomposition example.

This commit is contained in:
Crozet Sébastien
2021-01-20 15:15:03 +01:00
parent 87b56c38b6
commit e2006599a8
24 changed files with 37924 additions and 8 deletions

View File

@@ -9,7 +9,7 @@ pub use self::joint::{
};
pub use self::rigid_body::{ActivationStatus, BodyStatus, RigidBody, RigidBodyBuilder};
pub use self::rigid_body_set::{BodyPair, RigidBodyHandle, RigidBodySet};
pub use cdl::shape::MassProperties;
pub use cdl::mass_properties::MassProperties;
// #[cfg(not(feature = "parallel"))]
pub(crate) use self::joint::JointGraphEdge;
pub(crate) use self::rigid_body::RigidBodyChanges;

View File

@@ -140,7 +140,7 @@ impl ColliderShape {
}
#[cfg(feature = "dim3")]
pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[usize]) -> Option<Self> {
pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[Point3<u32>]) -> Option<Self> {
ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| ColliderShape(Arc::new(ch)))
}
@@ -174,7 +174,7 @@ impl ColliderShape {
#[cfg(feature = "dim3")]
pub fn round_convex_mesh(
points: Vec<Point<Real>>,
indices: &[usize],
indices: &[Point<u32>],
border_radius: Real,
) -> Option<Self> {
ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| {
@@ -578,14 +578,14 @@ impl ColliderBuilder {
}
#[cfg(feature = "dim3")]
pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[usize]) -> Option<Self> {
pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[Point3<u32>]) -> Option<Self> {
ColliderShape::convex_mesh(points, indices).map(|cp| Self::new(cp))
}
#[cfg(feature = "dim3")]
pub fn round_convex_mesh(
points: Vec<Point<Real>>,
indices: &[usize],
indices: &[Point<u32>],
border_radius: Real,
) -> Option<Self> {
ColliderShape::round_convex_mesh(points, indices, border_radius).map(|cp| Self::new(cp))