diff options
| author | Thierry Berger <contact@thierryberger.com> | 2025-01-08 17:16:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-08 17:16:34 +0100 |
| commit | dc4bd24da869cfa8143c3ee9a98cdec662db289e (patch) | |
| tree | 6ea25968a264636f40c4042ef19f3a25d9c4f52f /src/geometry/collider.rs | |
| parent | cf77b5bf574f8363794f979510deec5c08e58401 (diff) | |
| download | rapier-dc4bd24da869cfa8143c3ee9a98cdec662db289e.tar.gz rapier-dc4bd24da869cfa8143c3ee9a98cdec662db289e.tar.bz2 rapier-dc4bd24da869cfa8143c3ee9a98cdec662db289e.zip | |
Update to Parry 0.18 (#770)
* update to parry ~main
* use traverse_depth_first
* add example to test intersection
* rely on upstream PR rather than local
* re-enable profiler_ui for examples
* rely on official parry repository
* chore: switch back to the published version of parry
* chore: update changelog
* chore: remove dead code
* fix compilation of rapier3d-meshloader and rapier3d-urdf
* chore: cargo fmt
---------
Co-authored-by: Sébastien Crozet <sebcrozet@dimforge.com>
Diffstat (limited to 'src/geometry/collider.rs')
| -rw-r--r-- | src/geometry/collider.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index c0cec6b..4f5312f 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -10,7 +10,7 @@ use crate::pipeline::{ActiveEvents, ActiveHooks}; use crate::prelude::ColliderEnabled; use na::Unit; use parry::bounding_volume::{Aabb, BoundingVolume}; -use parry::shape::{Shape, TriMeshFlags}; +use parry::shape::{Shape, TriMeshBuilderError, TriMeshFlags}; #[cfg(feature = "dim3")] use crate::geometry::HeightFieldFlags; @@ -685,8 +685,11 @@ 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<[u32; 3]>) -> Self { - Self::new(SharedShape::trimesh(vertices, indices)) + pub fn trimesh( + vertices: Vec<Point<Real>>, + indices: Vec<[u32; 3]>, + ) -> Result<Self, TriMeshBuilderError> { + Ok(Self::new(SharedShape::trimesh(vertices, indices)?)) } /// Initializes a collider builder with a triangle mesh shape defined by its vertex and index buffers and @@ -695,8 +698,10 @@ impl ColliderBuilder { vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>, flags: TriMeshFlags, - ) -> Self { - Self::new(SharedShape::trimesh_with_flags(vertices, indices, flags)) + ) -> Result<Self, TriMeshBuilderError> { + Ok(Self::new(SharedShape::trimesh_with_flags( + vertices, indices, flags, + )?)) } /// Initializes a collider builder with a shape converted from the given triangle mesh index |
