0
\$\begingroup\$

I'm trying to simulate flight using box2d and libgdx.

The main problem I am currently experiencing is with inertia: since there is no air, the plane looks like it were drifting.

I wasn't able how to turn off inertia.

I have two ideas:

  1. Imitate air resistance by applying force

  2. Imitate flight using linear velocity without using any box2d physics

Are any of these two ways correct? Or maybe there is way to turn off inertia?

\$\endgroup\$
2
\$\begingroup\$

I would try creating a simulation of all the forces that are applied to an airplane. So collect the forces that you need and apply all of them to the rigidobject. I'm no expert, but I would start with:

  • Air resistance as (e.g. F=-c*v^2 where c is some factor and v is the velocity). The c factor will most likely change based on velocity and orientation of the airplane since the surface is very different because of the wings.
  • Engine power applied in the airplane's direction.
  • Lift based on velocity.
  • Gravity.

Then you'll probably need some fake forces to get around the ones you're missing.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.