From 4fb6673ff70b05f4ebfa09904466965bda3423e4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 11 Dec 2002 22:52:52 +0000 Subject: [PATCH] Update masses on the rigid body when consuming fuel. Simply updating the tank capacity won't change the aircraft. --- src/FDM/YASim/Airplane.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/FDM/YASim/Airplane.cpp b/src/FDM/YASim/Airplane.cpp index 058221d99..04d1b87ef 100644 --- a/src/FDM/YASim/Airplane.cpp +++ b/src/FDM/YASim/Airplane.cpp @@ -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()