From ee679427cda6363e4de94a59e293d01133a44d1f Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sat, 16 Apr 2022 11:54:03 +0200 Subject: Fix mass-properties update after collider change --- src/geometry/collider.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/geometry') diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index eaca5a6..3113e5e 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -411,21 +411,18 @@ impl ColliderBuilder { /// Initialize a new collider builder with a capsule shape aligned with the `x` axis. pub fn capsule_x(half_height: Real, radius: Real) -> Self { - let p = Point::from(Vector::x() * half_height); - Self::new(SharedShape::capsule(-p, p, radius)) + Self::new(SharedShape::capsule_x(half_height, radius)) } /// Initialize a new collider builder with a capsule shape aligned with the `y` axis. pub fn capsule_y(half_height: Real, radius: Real) -> Self { - let p = Point::from(Vector::y() * half_height); - Self::new(SharedShape::capsule(-p, p, radius)) + Self::new(SharedShape::capsule_y(half_height, radius)) } /// Initialize a new collider builder with a capsule shape aligned with the `z` axis. #[cfg(feature = "dim3")] pub fn capsule_z(half_height: Real, radius: Real) -> Self { - let p = Point::from(Vector::z() * half_height); - Self::new(SharedShape::capsule(-p, p, radius)) + Self::new(SharedShape::capsule_z(half_height, radius)) } /// Initialize a new collider builder with a cuboid shape defined by its half-extents. -- cgit