From bc3e80b2cbb35c74b228366ec3bb47e9dcaf49b2 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Thu, 1 Dec 2022 08:40:24 +0100 Subject: [PATCH] =?UTF-8?q?Sascha=20Rei=C3=9Fner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change all constant numeric values with the defined constant. Changed the wrong '*offset-m' properties and the 'rollspeed-ms' property. Maybe the wrong offset properties hasnt popped up because no dev used it. This value will not be used in any animation because its normally a fixed value that doesnt change at runtime. --- src/FDM/JSBSim/JSBSim.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index b72a439e6..718da8760 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -1255,12 +1255,12 @@ void FGJSBsim::init_gear(void ) node->setDoubleValue("yoffset-in", gear->GetBodyLocation()(2) * 12); node->setDoubleValue("zoffset-in", gear->GetBodyLocation()(3) * 12); - node->setDoubleValue("xoffset-m", gear->GetBodyLocation()(1) * 0.08333333); - node->setDoubleValue("yoffset-m", gear->GetBodyLocation()(2) * 0.08333333); - node->setDoubleValue("zoffset-m", gear->GetBodyLocation()(3) * 0.08333333); + node->setDoubleValue("xoffset-m", gear->GetBodyLocation()(1) * SG_FEET_TO_METER); + node->setDoubleValue("yoffset-m", gear->GetBodyLocation()(2) * SG_FEET_TO_METER); + node->setDoubleValue("zoffset-m", gear->GetBodyLocation()(3) * SG_FEET_TO_METER); node->setBoolValue("wow", gear->GetWOW()); - node->setDoubleValue("rollspeed-ms", gear->GetWheelRollVel()*0.3043); + node->setDoubleValue("rollspeed-ms", gear->GetWheelRollVel() * SG_FEET_TO_METER); node->setBoolValue("has-brake", gear->GetBrakeGroup() > 0); node->setDoubleValue("position-norm", gear->GetGearUnitPos()); // node->setDoubleValue("tire-pressure-norm", gear->GetTirePressure()); @@ -1268,10 +1268,10 @@ void FGJSBsim::init_gear(void ) if (max < 0.00001) { max = node->getDoubleValue("max-compression-m"); if (max < 0.00001) max = 1.0; - else max /= .3048; + else max /= SG_FEET_TO_METER; } node->setDoubleValue("compression-norm", gear->GetCompLen() / max); - node->setDoubleValue("compression-m", gear->GetCompLen() * .3048); + node->setDoubleValue("compression-m", gear->GetCompLen() * SG_FEET_TO_METER); node->setDoubleValue("compression-ft", gear->GetCompLen()); if ( gear->GetSteerable() ) node->setDoubleValue("steering-norm", gear->GetSteerNorm()); @@ -1287,17 +1287,17 @@ void FGJSBsim::update_gear(void) FGLGear *gear = gr->GetGearUnit(i); SGPropertyNode * node = fgGetNode("gear/gear", i, true); node->getChild("wow", 0, true)->setBoolValue( gear->GetWOW()); - node->getChild("rollspeed-ms", 0, true)->setDoubleValue(gear->GetWheelRollVel()*0.3043); + node->getChild("rollspeed-ms", 0, true)->setDoubleValue(gear->GetWheelRollVel() * SG_FEET_TO_METER); node->getChild("position-norm", 0, true)->setDoubleValue(gear->GetGearUnitPos()); // gear->SetTirePressure(node->getDoubleValue("tire-pressure-norm")); max = node->getDoubleValue("max-compression-ft"); if (max < 0.00001) { max = node->getDoubleValue("max-compression-m"); if (max < 0.00001) max = 1.0; - else max /= .3048; + else max /= SG_FEET_TO_METER; } node->setDoubleValue("compression-norm", gear->GetCompLen() / max); - node->setDoubleValue("compression-m", gear->GetCompLen() * .3048); + node->setDoubleValue("compression-m", gear->GetCompLen() * SG_FEET_TO_METER); node->setDoubleValue("compression-ft", gear->GetCompLen()); if ( gear->GetSteerable() ) node->setDoubleValue("steering-norm", gear->GetSteerNorm());