PDA

View Full Version : Aircraft physics

NecroDOME
16-02-2007, 08:11 AM
So, I got a plane in the air, it flys forward, it can crash onto the ground with gravity, but it still has some space physics: when I make 180 in mid-air, it flies backward :|

So I need somehow a force that compensate this. How can I simply add that force? (aerodynamics).

btw, I'm using Newton for physics...

Eric
16-02-2007, 10:37 AM
Wikipedia's article is complete enough for simulation math:
http://en.wikipedia.org/wiki/Flight_dynamics
though you'll have to hunt around for interesting values of the constants.

If you don't want to go all the way, you can already achieve a "less space" by accounting for air friction forces, though these apply in a simple fashion only when the aircraft isn't "stalled" (i.e flying forward at a sufficient speed). Beyond drag, lift and gravity, you need to take into account air friction on fuselage, which on a normal aircraft will tend to align the fuselage with the direction of movement, and resist any change (there is a spiral effect, but let's disreguard this one).
A rough approximation of these forces can be given by 2 coeffs, the differential between movement vector and the fuselage vector, and the airspeed.
The 2 friction coeffs are those for "anormal" flight, the one if your aircraft was flying sideways (like a crab!), and the one when your aircraft is flying up/down (falling flat), of course, those two later coeffs are enormous compared to that of the normal flight (drag), and they result in enormous torque (the kind that can break a plane).
Multiply the coeffs by the sinus of the relevant angle between movement vector and fuselage vector, then multiply by the square of the airspeed to get the torque.
When applying yaw or pitch, apply torque to your aircraft fuselage, the above forces will prevent your aircraft from spinning away.

For roll friction, a coeff multiplied by the rolling angular speed and the airspeed will make a decent enough approximation. Usually, aircrafts roll much better than they turn or pitch, though as soon as you leave the horizontal, the lift can change significantly which affects the roll (unless it's a jet fighter, those can pretty much roll without that affecting their flight vector very significantly).

NecroDOME
16-02-2007, 11:38 AM
If you don't want to go all the way, you can already achieve a "less space" by accounting for air friction forces, though these apply in a simple fashion only when not the aircraft isn't "stalled" (i.e flying forward at a sufficient speed).

About fuel: I'm not gonna use any... :P , gameplay is to short I think...

thnx for the link... will take a look when i get home...

NecroDOME
18-02-2007, 12:17 PM
Well, My aircraft flies :) and applying a lot of damping (1.0 is max in newton) it doesn't look realistic, but it flies :) .

Question: How can I apply damping myself?

Huehnerschaender
18-02-2007, 12:20 PM
You could add an additional force in the ForceAndTorqueCallBack. I don't know what force you need here, but I guess normally this would be done in this callback (where you add gravity force etc).

NecroDOME
18-02-2007, 12:48 PM
I add forces in that callback :) ... it still needs to be tuned more...