1
0
Fork 0

Sascha Reißner

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.
This commit is contained in:
Erik Hofman 2022-12-01 08:40:24 +01:00
parent 5800143b96
commit bc3e80b2cb

View file

@ -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());