diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-10-27 09:20:40 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-10-27 09:20:44 +0100 |
| commit | 8c872dc0af9ece127a87b4adb112b0e1ed6ab249 (patch) | |
| tree | 309c79a7cf538e47218c92a90784bd1a2c3c04d7 /src/geometry/collider.rs | |
| parent | dbdd797d5934ee76b0358b6cf845575ce0ef29af (diff) | |
| download | rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.tar.gz rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.tar.bz2 rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.zip | |
Replace the Rounded<S> type by a non-generic RoundCylinder type.
Diffstat (limited to 'src/geometry/collider.rs')
| -rw-r--r-- | src/geometry/collider.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index d4f685c..522f002 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -4,7 +4,7 @@ use crate::geometry::{ Segment, Shape, ShapeType, Triangle, Trimesh, }; #[cfg(feature = "dim3")] -use crate::geometry::{Cone, Cylinder, Rounded}; +use crate::geometry::{Cone, Cylinder, RoundCylinder}; use crate::math::{AngVector, Isometry, Point, Rotation, Vector}; use na::Point3; use ncollide::bounding_volume::AABB; @@ -39,10 +39,11 @@ impl ColliderShape { /// (along along the y axis), its radius, and its roundedness (the /// radius of the sphere used for dilating the cylinder). #[cfg(feature = "dim3")] - pub fn round_cylinder(half_height: f32, radius: f32, round_radius: f32) -> Self { - ColliderShape(Arc::new(Rounded::new( - Cylinder::new(half_height, radius), - round_radius, + pub fn round_cylinder(half_height: f32, radius: f32, border_radius: f32) -> Self { + ColliderShape(Arc::new(RoundCylinder::new( + half_height, + radius, + border_radius, ))) } @@ -170,7 +171,7 @@ impl<'de> serde::Deserialize<'de> for ColliderShape { #[cfg(feature = "dim3")] Some(ShapeType::Cone) => deser::<A, Cone>(&mut seq)?, #[cfg(feature = "dim3")] - Some(ShapeType::RoundCylinder) => deser::<A, Rounded<Cylinder>>(&mut seq)?, + Some(ShapeType::RoundCylinder) => deser::<A, RoundCylinder>(&mut seq)?, None => { return Err(serde::de::Error::custom( "found invalid shape type to deserialize", @@ -332,11 +333,11 @@ impl ColliderBuilder { /// (along along the y axis), its radius, and its roundedness (the /// radius of the sphere used for dilating the cylinder). #[cfg(feature = "dim3")] - pub fn round_cylinder(half_height: f32, radius: f32, round_radius: f32) -> Self { + pub fn round_cylinder(half_height: f32, radius: f32, border_radius: f32) -> Self { Self::new(ColliderShape::round_cylinder( half_height, radius, - round_radius, + border_radius, )) } |
