diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-10-30 17:23:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-30 17:23:49 +0100 |
| commit | 6b9762694673d42671d58d9e2178b9c94fc39053 (patch) | |
| tree | 12bd8ca98467a5f1113670c1bc17ed20f2e69c80 /src/geometry/collider.rs | |
| parent | 2bf61c3bae542e2f17e7d25f602090bb3c117dbf (diff) | |
| parent | 34b7ae32fd03803048b920c1429e026e06bff948 (diff) | |
| download | rapier-6b9762694673d42671d58d9e2178b9c94fc39053.tar.gz rapier-6b9762694673d42671d58d9e2178b9c94fc39053.tar.bz2 rapier-6b9762694673d42671d58d9e2178b9c94fc39053.zip | |
Merge pull request #410 from dimforge/parry_up
Update to parry 0.11
Diffstat (limited to 'src/geometry/collider.rs')
| -rw-r--r-- | src/geometry/collider.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index efe6304..95ae273 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -8,8 +8,8 @@ use crate::math::{AngVector, Isometry, Point, Real, Rotation, Vector, DIM}; use crate::parry::transformation::vhacd::VHACDParameters; use crate::pipeline::{ActiveEvents, ActiveHooks}; use na::Unit; -use parry::bounding_volume::AABB; -use parry::shape::Shape; +use parry::bounding_volume::Aabb; +use parry::shape::{Shape, TriMeshFlags}; #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[derive(Clone)] @@ -348,13 +348,13 @@ impl Collider { } /// Compute the axis-aligned bounding box of this collider. - pub fn compute_aabb(&self) -> AABB { + pub fn compute_aabb(&self) -> Aabb { self.shape.compute_aabb(&self.pos) } /// Compute the axis-aligned bounding box of this collider moving from its current position /// to the given `next_position` - pub fn compute_swept_aabb(&self, next_position: &Isometry<Real>) -> AABB { + pub fn compute_swept_aabb(&self, next_position: &Isometry<Real>) -> Aabb { self.shape.compute_swept_aabb(&self.pos, next_position) } @@ -550,6 +550,16 @@ impl ColliderBuilder { Self::new(SharedShape::trimesh(vertices, indices)) } + /// Initializes a collider builder with a triangle mesh shape defined by its vertex and index buffers and + /// flags controlling its pre-processing. + pub fn trimesh_with_flags( + vertices: Vec<Point<Real>>, + indices: Vec<[u32; 3]>, + flags: TriMeshFlags, + ) -> Self { + Self::new(SharedShape::trimesh_with_flags(vertices, indices, flags)) + } + /// Initializes a collider builder with a compound shape obtained from the decomposition of /// the given trimesh (in 3D) or polyline (in 2D) into convex parts. pub fn convex_decomposition(vertices: &[Point<Real>], indices: &[[u32; DIM]]) -> Self { |
