# How can I make okay jet physics?

I've got a couple days to get physics implemented to control a jet.  Currently I've got a single DynamicPhysicsNode representing my jet model with simple addForce methods to accelerate forward and move left/right.  Moving left/right looks funny because after the key is released the jet continues to move in that direction.  Since planes don't really move left or right this is a bit of a hack, but I figured if I could limit the left/right forces and couple it with some model tilting it wouldn't look too bad.

Also, this is my first time using jME physics.  So are there any good methods for making simple jet movement/flight physics?

Maybe add force with the addForce() method, and place the force at the 'tail' of the jet?

/**
* Add a force to be applied to this node at a given relative location. The force vector is given
* in world coordinate space. The force is applied in the next computation step and is cleared afterwards.
* Thus this method has to be called frequently (before each physics step) if a constant force should be applied.
*
* @param force force to be added (world coordinate space)
* @param at    position of the object where the force should be applied (relative to the center of mass)
* @see PhysicsUpdateCallback
*/
public abstract void addForce( Vector3f force, Vector3f at );

OooOh nice, that seems to be exactly what I would need (shame on me for not looking harder at the API).  Thank you!

So, if I apply this force at the center of the node, and I rotate the node along the x-axis, will the node move along the y-axis?  So if I tilt the nose of the plane up (rotate along the x-axis), will the plane move up? …that would be awesomely easy

So if I tilt the nose of the plane up (rotate along the x-axis), will the plane move up?

mhh  no.
The force you add to a object, has a direction.
The object will be pushed into that direction, no matter that the rotation of the object is.

What you can do is, add force into the direction the object is heading, something like:

Thats how i push a missile towards its target, the missile is rotated with lookAt().
(see this example)

But you also need to somehow get rid of the added force, or your jet will accelerate all the time.
You can use a FrictionCallback to remove the force over time.

// the HomingMissile needs a force Friction callback, to eliminate the force which
// pushes the rocked into the wrong (old) direction
FrictionCallback fcb = new FrictionCallback();

I can't think of a better way than simulating how it works on real world, or at least more or less how it works:

http://www.allstar.fiu.edu/aero/fltmidfly.html

this should help, just simulate all those forces and the plane will fly as it should.

plus, if you press "A" or "D" (or whatever keys) to make it turn right or left, create a force on the plane head that is perpendicular to it's direction and faces either right or left, it must get weaker as the plane gets faster, as the air resistance gets stronger, but this reduction can be reduced by the plane's aerodynamics (or anything like that)

think on your Physics classes at school and simulate how you think it works ;D