Rename rounded -> round.

This commit is contained in:
Crozet Sébastien
2020-10-20 18:14:20 +02:00
parent 949e3f5384
commit f7a6f433d6
7 changed files with 12 additions and 12 deletions

View File

@@ -59,7 +59,7 @@ pub fn init_world(testbed: &mut Testbed) {
1 => ColliderBuilder::ball(rad).build(), 1 => ColliderBuilder::ball(rad).build(),
// Rounded cylinders are much more efficient that cylinder, even if the // Rounded cylinders are much more efficient that cylinder, even if the
// rounding margin is small. // rounding margin is small.
2 => ColliderBuilder::rounded_cylinder(rad, rad, rad / 10.0).build(), 2 => ColliderBuilder::round_cylinder(rad, rad, rad / 10.0).build(),
_ => ColliderBuilder::cone(rad, rad).build(), _ => ColliderBuilder::cone(rad, rad).build(),
}; };

View File

@@ -55,7 +55,7 @@ pub fn init_world(testbed: &mut Testbed) {
1 => ColliderBuilder::ball(rad).build(), 1 => ColliderBuilder::ball(rad).build(),
// Rounded cylinders are much more efficient that cylinder, even if the // Rounded cylinders are much more efficient that cylinder, even if the
// rounding margin is small. // rounding margin is small.
2 => ColliderBuilder::rounded_cylinder(rad, rad, rad / 10.0).build(), 2 => ColliderBuilder::round_cylinder(rad, rad, rad / 10.0).build(),
_ => ColliderBuilder::cone(rad, rad).build(), _ => ColliderBuilder::cone(rad, rad).build(),
}; };

View File

@@ -69,7 +69,7 @@ pub fn init_world(testbed: &mut Testbed) {
1 => ColliderBuilder::ball(rad).build(), 1 => ColliderBuilder::ball(rad).build(),
// Rounded cylinders are much more efficient that cylinder, even if the // Rounded cylinders are much more efficient that cylinder, even if the
// rounding margin is small. // rounding margin is small.
2 => ColliderBuilder::rounded_cylinder(rad, rad, rad / 10.0).build(), 2 => ColliderBuilder::round_cylinder(rad, rad, rad / 10.0).build(),
_ => ColliderBuilder::cone(rad, rad).build(), _ => ColliderBuilder::cone(rad, rad).build(),
}; };

View File

@@ -39,7 +39,7 @@ impl ColliderShape {
/// (along along the y axis), its radius, and its roundedness (the /// (along along the y axis), its radius, and its roundedness (the
/// radius of the sphere used for dilating the cylinder). /// radius of the sphere used for dilating the cylinder).
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
pub fn rounded_cylinder(half_height: f32, radius: f32, rounding_radius: f32) -> Self { pub fn round_cylinder(half_height: f32, radius: f32, rounding_radius: f32) -> Self {
ColliderShape(Arc::new(Rounded::new( ColliderShape(Arc::new(Rounded::new(
Cylinder::new(half_height, radius), Cylinder::new(half_height, radius),
rounding_radius, rounding_radius,
@@ -164,7 +164,7 @@ impl<'de> serde::Deserialize<'de> for ColliderShape {
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
Some(ShapeType::Cone) => deser::<A, Cone>(&mut seq)?, Some(ShapeType::Cone) => deser::<A, Cone>(&mut seq)?,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
Some(ShapeType::RoundedCylinder) => deser::<A, Rounded<Cylinder>>(&mut seq)?, Some(ShapeType::RoundCylinder) => deser::<A, Rounded<Cylinder>>(&mut seq)?,
None => { None => {
return Err(serde::de::Error::custom( return Err(serde::de::Error::custom(
"found invalid shape type to deserialize", "found invalid shape type to deserialize",
@@ -326,8 +326,8 @@ impl ColliderBuilder {
/// (along along the y axis), its radius, and its roundedness (the /// (along along the y axis), its radius, and its roundedness (the
/// radius of the sphere used for dilating the cylinder). /// radius of the sphere used for dilating the cylinder).
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
pub fn rounded_cylinder(half_height: f32, radius: f32, rounding_radius: f32) -> Self { pub fn round_cylinder(half_height: f32, radius: f32, rounding_radius: f32) -> Self {
Self::new(ColliderShape::rounded_cylinder( Self::new(ColliderShape::round_cylinder(
half_height, half_height,
radius, radius,
rounding_radius, rounding_radius,

View File

@@ -98,8 +98,8 @@ impl ContactDispatcher for DefaultContactDispatcher {
| (_, ShapeType::Cylinder) | (_, ShapeType::Cylinder)
| (ShapeType::Cone, _) | (ShapeType::Cone, _)
| (_, ShapeType::Cone) | (_, ShapeType::Cone)
| (ShapeType::RoundedCylinder, _) | (ShapeType::RoundCylinder, _)
| (_, ShapeType::RoundedCylinder) => ( | (_, ShapeType::RoundCylinder) => (
PrimitiveContactGenerator { PrimitiveContactGenerator {
generate_contacts: super::generate_contacts_pfm_pfm, generate_contacts: super::generate_contacts_pfm_pfm,
..PrimitiveContactGenerator::default() ..PrimitiveContactGenerator::default()

View File

@@ -17,7 +17,7 @@ pub trait Roundable {
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
impl Roundable for Cylinder { impl Roundable for Cylinder {
fn rounded_shape_type() -> ShapeType { fn rounded_shape_type() -> ShapeType {
ShapeType::RoundedCylinder ShapeType::RoundCylinder
} }
} }

View File

@@ -48,7 +48,7 @@ pub enum ShapeType {
// RoundedHeightField, // RoundedHeightField,
/// A cylinder with rounded corners. /// A cylinder with rounded corners.
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
RoundedCylinder, RoundCylinder,
// /// A cone with rounded corners. // /// A cone with rounded corners.
// RoundedCone, // RoundedCone,
} }
@@ -345,7 +345,7 @@ impl Shape for Rounded<Cylinder> {
} }
fn shape_type(&self) -> ShapeType { fn shape_type(&self) -> ShapeType {
ShapeType::RoundedCylinder ShapeType::RoundCylinder
} }
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]