diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-01-20 15:40:00 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-01-20 15:40:00 +0100 |
| commit | 28b7866aee68ca844406bea4761d630a7913188d (patch) | |
| tree | c664c3dae65e5300f606e4f8cfb1198023173ea6 /src/geometry | |
| parent | e2006599a8fa90090393ff4fed326ee78fd7c0b7 (diff) | |
| download | rapier-28b7866aee68ca844406bea4761d630a7913188d.tar.gz rapier-28b7866aee68ca844406bea4761d630a7913188d.tar.bz2 rapier-28b7866aee68ca844406bea4761d630a7913188d.zip | |
Switch to [u32; DIM] instead of Point<u32> for element indices.
Diffstat (limited to 'src/geometry')
| -rw-r--r-- | src/geometry/collider.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index 8533c81..96fcbf9 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -12,7 +12,6 @@ use cdl::shape::{ }; #[cfg(feature = "dim2")] use cdl::shape::{ConvexPolygon, RoundConvexPolygon}; -use na::Point3; use std::ops::Deref; use std::sync::Arc; @@ -123,7 +122,7 @@ impl ColliderShape { } /// Initializes a triangle mesh shape defined by its vertex and index buffers. - pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<Point3<u32>>) -> Self { + pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self { ColliderShape(Arc::new(TriMesh::new(vertices, indices))) } @@ -140,7 +139,7 @@ impl ColliderShape { } #[cfg(feature = "dim3")] - pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[Point3<u32>]) -> Option<Self> { + pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[[u32; 3]]) -> Option<Self> { ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| ColliderShape(Arc::new(ch))) } @@ -174,7 +173,7 @@ impl ColliderShape { #[cfg(feature = "dim3")] pub fn round_convex_mesh( points: Vec<Point<Real>>, - indices: &[Point<u32>], + indices: &[[u32; 3]], border_radius: Real, ) -> Option<Self> { ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| { @@ -555,7 +554,7 @@ impl ColliderBuilder { } /// Initializes a collider builder with a triangle mesh shape defined by its vertex and index buffers. - pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<Point3<u32>>) -> Self { + pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self { Self::new(ColliderShape::trimesh(vertices, indices)) } @@ -578,14 +577,14 @@ impl ColliderBuilder { } #[cfg(feature = "dim3")] - pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[Point3<u32>]) -> Option<Self> { + pub fn convex_mesh(points: Vec<Point<Real>>, indices: &[[u32; 3]]) -> 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: &[Point<u32>], + indices: &[[u32; 3]], border_radius: Real, ) -> Option<Self> { ColliderShape::round_convex_mesh(points, indices, border_radius).map(|cp| Self::new(cp)) |
