]> git.mxchange.org Git - flightgear.git/commitdiff
Update masses on the rigid body when consuming fuel. Simply updating
authorandy <andy>
Wed, 11 Dec 2002 22:52:52 +0000 (22:52 +0000)
committerandy <andy>
Wed, 11 Dec 2002 22:52:52 +0000 (22:52 +0000)
the tank capacity won't change the aircraft.

src/FDM/YASim/Airplane.cpp

index 058221d991f527047fcca2595de74155ceaffebc..04d1b87ef223b8aa1f90a65f7d9ee33101f37b9b 100644 (file)
@@ -86,6 +86,12 @@ void Airplane::consumeFuel(float dt)
     if(outOfFuel)
         for(int i=0; i<_thrusters.size(); i++)
             ((ThrustRec*)_thrusters.get(i))->thruster->setFuelState(false);
+
+    // Set the tank masses on the RigidBody
+    for(i=0; i<_tanks.size(); i++) {
+        Tank* t = (Tank*)_tanks.get(i);
+        _model.getBody()->setMass(t->handle, t->fill);
+    }
 }
 
 ControlMap* Airplane::getControlMap()