diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 4ac88ee978..0d83b1851d 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -293,7 +293,7 @@ impl Body { /// The width (shoulder to shoulder), length (nose to tail) and height /// respectively - pub fn dimensions(&self) -> Vec3 { + pub const fn dimensions(&self) -> Vec3 { match self { Body::BipedLarge(body) => match body.species { biped_large::Species::Cyclops => Vec3::new(4.6, 3.0, 6.5), @@ -398,7 +398,7 @@ impl Body { dim.x.max(dim.y) / 2.0 } - pub fn height(&self) -> f32 { self.dimensions().z } + pub const fn height(&self) -> f32 { self.dimensions().z } pub fn collider_shape(&self) -> Collider { Collider::Box { diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index 6de2c5ca86..8d41cf3172 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -341,7 +341,7 @@ impl Body { Mass(m) } - pub fn dimensions(&self) -> Vec3 { + pub const fn dimensions(&self) -> Vec3 { match self { Body::Arrow | Body::ArrowSnake | Body::MultiArrow | Body::ArrowTurret => { Vec3::new(0.01, 0.8, 0.01) @@ -349,7 +349,7 @@ impl Body { Body::BoltFire => Vec3::new(0.1, 0.1, 0.1), Body::Crossbow => Vec3::new(3.0, 3.0, 1.5), Body::HaniwaSentry => Vec3::new(0.8, 0.8, 1.4), - _ => Vec3::broadcast(0.5), + _ => Vec3::new(0.5, 0.5, 0.5), } } } diff --git a/common/src/comp/body/ship.rs b/common/src/comp/body/ship.rs index f880683d47..fe8022e5c6 100644 --- a/common/src/comp/body/ship.rs +++ b/common/src/comp/body/ship.rs @@ -26,7 +26,7 @@ impl Body { } } - pub fn dimensions(&self) -> Vec3 { Vec3::new(25.0, 50.0, 40.0) } + pub const fn dimensions(&self) -> Vec3 { Vec3::new(25.0, 50.0, 40.0) } fn balloon_vol(&self) -> f32 { let spheroid_vol = |equat_d: f32, polar_d: f32| -> f32 {