From: Vivian Meazza Date: Mon, 21 Nov 2011 09:09:12 +0000 (+0000) Subject: Make parameter "roll-factor" settable in scenario files X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b1391e404b11e0d9a5bfcd11c1307e2e9531616;p=flightgear.git Make parameter "roll-factor" settable in scenario files Signed-off-by: Vivian Meazza --- diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index b7ce2ef34..c6cfa7a05 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -101,6 +101,7 @@ void FGAIShip::readFromScenario(SGPropertyNode* scFileNode) { setFixedTurnRadius(scFileNode->getDoubleValue("fixed-turn-radius-ft", 500)); setSpeedConstant(scFileNode->getDoubleValue("speed-constant", 0.5)); setSMPath(scFileNode->getStringValue("submodel-path", "")); + setRollFactor(scFileNode->getDoubleValue("roll-factor", 1)); if (!flightplan.empty()) { SG_LOG(SG_AI, SG_ALERT, "getting flightplan: " << _name ); @@ -560,6 +561,10 @@ void FGAIShip::setFixedTurnRadius(double ftr) { _fixed_turn_radius = ftr; } +void FGAIShip::setRollFactor(double rf) { + _roll_factor = rf * -0.0083335; +} + void FGAIShip::setInitialTunnel(bool t) { _initial_tunnel = t; setTunnel(_initial_tunnel); diff --git a/src/AIModel/AIShip.hxx b/src/AIModel/AIShip.hxx index 591aa6166..f82a14f8d 100644 --- a/src/AIModel/AIShip.hxx +++ b/src/AIModel/AIShip.hxx @@ -61,11 +61,14 @@ public: void setRudderConstant(double rc); void setSpeedConstant(double sc); void setFixedTurnRadius(double ft); + void setRollFactor(double rf); + void setTunnel(bool t); void setInitialTunnel(bool t); void setWPNames(); void setWPPos(); + double sign(double x); bool _hdg_lock;