Skip to content

Commit

Permalink
Remove unnecessary cfg_attr from from_shape mass helpers (#644)
Browse files Browse the repository at this point in the history
# Objective

Some mass property helpers like `Mass::from_shape` are currently gated behind the `default-collider` feature and Parry, even though they don't need these features anymore.

## Solution

Remove the feature gates.
  • Loading branch information
Jondolf authored Jan 30, 2025
1 parent 11e64a1 commit be9ebc5
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/dynamics/rigid_body/mass_properties/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ impl Mass {
doc = "let mass = Mass::from_shape(&Sphere::new(1.0), 2.0);"
)]
/// ```
#[cfg(all(
feature = "default-collider",
any(feature = "parry-f32", feature = "parry-f64")
))]
#[inline]
pub fn from_shape<T: ComputeMassProperties>(shape: &T, density: f32) -> Self {
Self(shape.mass(density))
Expand Down Expand Up @@ -344,10 +340,6 @@ impl AngularInertia {
/// // Bevy's primitive shapes can also be used.
/// let inertia = AngularInertia::from_shape(&Circle::new(1.0), 2.0);
/// ```
#[cfg(all(
feature = "default-collider",
any(feature = "parry-f32", feature = "parry-f64")
))]
#[inline]
pub fn from_shape<T: ComputeMassProperties>(shape: &T, mass: f32) -> Self {
Self(shape.angular_inertia(mass))
Expand Down Expand Up @@ -682,10 +674,6 @@ impl AngularInertia {
/// // Bevy's primitive shapes can also be used.
/// let inertia = AngularInertia::from_shape(&Sphere::new(1.0), 2.0);
/// ```
#[cfg(all(
feature = "default-collider",
any(feature = "parry-f32", feature = "parry-f64")
))]
#[inline]
pub fn from_shape<T: ComputeMassProperties>(shape: &T, mass: f32) -> Self {
let principal = shape.principal_angular_inertia(mass);
Expand Down Expand Up @@ -916,10 +904,6 @@ impl CenterOfMass {
doc = "let center_of_mass = CenterOfMass::from_shape(&Sphere::new(1.0));"
)]
/// ```
#[cfg(all(
feature = "default-collider",
any(feature = "parry-f32", feature = "parry-f64")
))]
#[inline]
pub fn from_shape<T: ComputeMassProperties>(shape: &T) -> Self {
Self(shape.center_of_mass())
Expand Down Expand Up @@ -1038,10 +1022,6 @@ impl MassPropertiesBundle {
/// ));
/// # }
/// ```
#[cfg(all(
feature = "default-collider",
any(feature = "parry-f32", feature = "parry-f64")
))]
#[inline]
pub fn from_shape<T: ComputeMassProperties>(shape: &T, density: f32) -> Self {
shape.mass_properties(density).to_bundle()
Expand Down

0 comments on commit be9ebc5

Please sign in to comment.