diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-04-16 11:54:03 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-04-20 17:11:06 +0200 |
| commit | ee679427cda6363e4de94a59e293d01133a44d1f (patch) | |
| tree | c7b9ddd17c4d8580020d1037ccc375211bc1ee3d /src/geometry | |
| parent | 775c45e9ff13de088566c51697c667626cecf91e (diff) | |
| download | rapier-ee679427cda6363e4de94a59e293d01133a44d1f.tar.gz rapier-ee679427cda6363e4de94a59e293d01133a44d1f.tar.bz2 rapier-ee679427cda6363e4de94a59e293d01133a44d1f.zip | |
Fix mass-properties update after collider change
Diffstat (limited to 'src/geometry')
| -rw-r--r-- | src/geometry/collider.rs | 9 |
1 files changed, 3 insertions, 6 deletions
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. |
