]> git.mxchange.org Git - flightgear.git/commitdiff
Make parameter "roll-factor" settable in scenario files
authorVivian Meazza <vivian.meazza@lineone.net>
Mon, 21 Nov 2011 09:09:12 +0000 (09:09 +0000)
committerAnders Gidenstam <anders@gidenstam.org>
Sun, 4 Dec 2011 18:10:42 +0000 (19:10 +0100)
Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
src/AIModel/AIShip.cxx
src/AIModel/AIShip.hxx

index b7ce2ef348ef696b79a7baa335f7cd729b945528..c6cfa7a0533d9d320465f065874f2fe45a383a29 100644 (file)
@@ -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);
index 591aa616683bdce3a7ff8012fbff4934722dc957..f82a14f8d1be975419095ccc35fcb3c9bd8ec319 100644 (file)
@@ -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;