1
0
Fork 0

Update masses on the rigid body when consuming fuel. Simply updating

the tank capacity won't change the aircraft.
This commit is contained in:
andy 2002-12-11 22:52:52 +00:00
parent c3398c9add
commit 4fb6673ff7

View 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()