From b779eb261e7c3e816c8b586f1f496dcd17dbf700 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Fri, 22 Jan 2021 16:43:16 +0100 Subject: Fix compilation in 2D. --- src/geometry/collider_shape.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/geometry/collider_shape.rs') diff --git a/src/geometry/collider_shape.rs b/src/geometry/collider_shape.rs index 05067ef..ed91b82 100644 --- a/src/geometry/collider_shape.rs +++ b/src/geometry/collider_shape.rs @@ -154,6 +154,14 @@ impl ColliderShape { let mut parts = vec![]; let decomp = VHACD::decompose(params, &vertices, &indices, true); + #[cfg(feature = "dim2")] + for vertices in decomp.compute_exact_convex_hulls(&vertices, &indices) { + if let Some(convex) = Self::convex_polyline(vertices) { + parts.push((Isometry::identity(), convex)); + } + } + + #[cfg(feature = "dim3")] for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) { if let Some(convex) = Self::convex_mesh(vertices, &indices) { parts.push((Isometry::identity(), convex)); @@ -174,6 +182,14 @@ impl ColliderShape { let mut parts = vec![]; let decomp = VHACD::decompose(params, &vertices, &indices, true); + #[cfg(feature = "dim2")] + for vertices in decomp.compute_exact_convex_hulls(&vertices, &indices) { + if let Some(convex) = Self::round_convex_polyline(vertices, border_radius) { + parts.push((Isometry::identity(), convex)); + } + } + + #[cfg(feature = "dim3")] for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) { if let Some(convex) = Self::round_convex_mesh(vertices, &indices, border_radius) { parts.push((Isometry::identity(), convex)); -- cgit