diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index ee8fce1d25..ced563e1fd 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -757,15 +757,19 @@ impl Drag for Body { /// /// This coefficient includes the reference area. fn parasite_drag_coefficient(&self) -> f32 { + // Scale modifier to reduce or increase drag as needed to give bodies reasonable + // terminal velocities for the gravitational acceleration of this world + // const SCALE_MODIFIER: f32 = 0.6; // if we can eventually have 1G + const SCALE_MODIFIER: f32 = 1.1; // for 2.5G + // Reference area and drag coefficient assumes best-case scenario of the // orientation producing least amount of drag match self { // Cross-section, head/feet first Body::BipedLarge(_) | Body::BipedSmall(_) | Body::Golem(_) | Body::Humanoid(_) => { - // const SCALE: f32 = 0.7; - let radius = self.dimensions().xy().map(|a| inline_tweak::tweak!(0.6) * a * 0.5); + let radii = self.dimensions().xy().map(|a| SCALE_MODIFIER * a * 0.5); const CD: f32 = 0.7; - CD * PI * radius.x * radius.y + CD * PI * radii.x * radii.y }, // Cross-section, nose/tail first @@ -773,13 +777,13 @@ impl Drag for Body { | Body::QuadrupedMedium(_) | Body::QuadrupedSmall(_) | Body::QuadrupedLow(_) => { - let radius = self.dimensions().map(|a| a * 0.5); + let radii = self.dimensions().map(|a| SCALE_MODIFIER * a * 0.5); let cd: f32 = if matches!(self, Body::QuadrupedLow(_)) { 0.7 } else { 1.0 }; - cd * PI * radius.x * radius.z + cd * PI * radii.x * radii.z }, Body::BirdMedium(bird) => bird.parasite_drag_coefficient(), @@ -788,11 +792,11 @@ impl Drag for Body { // Cross-section, zero-lift angle; exclude the fins Body::FishMedium(_) | Body::FishSmall(_) => { - let radius = self.dimensions().map(|a| a * 0.5); + let radii = self.dimensions().map(|a| SCALE_MODIFIER * a * 0.5); // "A Simple Method to Determine Drag Coefficients in Aquatic Animals", // D. Bilo and W. Nachtigall, 1980 const CD: f32 = 0.031; - CD * PI * radius.x * radius.z + CD * PI * radii.x * radii.z }, Body::Object(object) => match object { @@ -807,9 +811,9 @@ impl Drag for Body { | object::Body::FireworkWhite | object::Body::FireworkYellow | object::Body::MultiArrow => { - let radius = self.dimensions().map(|a| a * 0.5); + let radii = self.dimensions().map(|a| SCALE_MODIFIER * a * 0.5); const CD: f32 = 0.02; - CD * PI * radius.x * radius.z + CD * PI * radii.x * radii.z }, // spherical-ish objects @@ -826,13 +830,13 @@ impl Drag for Body { | object::Body::Pumpkin3 | object::Body::Pumpkin4 | object::Body::Pumpkin5 => { - let radius = self.dimensions().xy().map(|a| a * 0.5); + let radii = self.dimensions().xy().map(|a| SCALE_MODIFIER * a * 0.5); const CD: f32 = 0.5; - CD * PI * radius.product() + CD * PI * radii.product() }, _ => { - let dim = self.dimensions(); + let dim = self.dimensions().map(|a| SCALE_MODIFIER * a); const CD: f32 = 2.0; CD * (PI / 6.0 * dim.x * dim.y * dim.z).powf(2.0 / 3.0) }, @@ -841,7 +845,7 @@ impl Drag for Body { Body::Ship(_) => { // Airships tend to use the square of the cube root of its volume for // reference area - let dim = self.dimensions(); + let dim = self.dimensions().map(|a| SCALE_MODIFIER * a); (PI / 6.0 * dim.x * dim.y * dim.z).powf(2.0 / 3.0) }, } diff --git a/common/src/consts.rs b/common/src/consts.rs index e55fee68bc..4cbaa9598e 100644 --- a/common/src/consts.rs +++ b/common/src/consts.rs @@ -2,7 +2,7 @@ pub const MAX_PICKUP_RANGE: f32 = 8.0; pub const MAX_MOUNT_RANGE: f32 = 14.0; -pub const GRAVITY: f32 = 9.81; +pub const GRAVITY: f32 = 25.0; pub const FRIC_GROUND: f32 = 0.15; // Values for air taken from http://www-mdp.eng.cam.ac.uk/web/library/enginfo/aerothermal_dvd_only/aero/atmos/atmos.html