aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2021-01-22 16:43:16 +0100
committerCrozet Sébastien <developer@crozet.re>2021-01-22 16:43:16 +0100
commitb779eb261e7c3e816c8b586f1f496dcd17dbf700 (patch)
tree60322ff9e3ea25182a584b523a2f7231cb3f479b /src
parent99c2184e134b40cca9cb22fe93a95a64295ae048 (diff)
downloadrapier-b779eb261e7c3e816c8b586f1f496dcd17dbf700.tar.gz
rapier-b779eb261e7c3e816c8b586f1f496dcd17dbf700.tar.bz2
rapier-b779eb261e7c3e816c8b586f1f496dcd17dbf700.zip
Fix compilation in 2D.
Diffstat (limited to 'src')
-rw-r--r--src/dynamics/solver/parallel_island_solver.rs2
-rw-r--r--src/geometry/collider.rs2
-rw-r--r--src/geometry/collider_shape.rs16
3 files changed, 17 insertions, 3 deletions
diff --git a/src/dynamics/solver/parallel_island_solver.rs b/src/dynamics/solver/parallel_island_solver.rs
index 24435db..af8e9c0 100644
--- a/src/dynamics/solver/parallel_island_solver.rs
+++ b/src/dynamics/solver/parallel_island_solver.rs
@@ -251,7 +251,7 @@ impl ParallelIslandSolver {
let dvel = mj_lambdas[rb.active_set_offset];
rb.linvel += dvel.linear;
rb.angvel += rb.effective_world_inv_inertia_sqrt.transform_vector(dvel.angular);
- rb.integrate(params.dt));
+ rb.integrate(params.dt);
positions[rb.active_set_offset] = rb.position;
}
}
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs
index 232b246..4ad3295 100644
--- a/src/geometry/collider.rs
+++ b/src/geometry/collider.rs
@@ -4,8 +4,6 @@ use crate::geometry::{ColliderShape, InteractionGroups};
use crate::math::{AngVector, Isometry, Point, Real, Rotation, Vector, DIM};
use cdl::bounding_volume::AABB;
use cdl::shape::Shape;
-#[cfg(feature = "dim2")]
-use cdl::shape::{ConvexPolygon, RoundConvexPolygon};
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
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));