aboutsummaryrefslogtreecommitdiff
path: root/src/geometry
diff options
context:
space:
mode:
Diffstat (limited to 'src/geometry')
-rw-r--r--src/geometry/collider.rs9
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.