3
\$\begingroup\$

I have never given it much of a thought about how physics engines operate behind the scenes.

Though, I am currently working on a game that would greatly benefit from as precise as possible physics model, hence the question.

To apply the counter forces, do physics engines, such as Havoc, Bullet and PhysX, take into account the actual shape of the mesh (probably only it's collider) or they operate solely as math functions working with only the predefined physical variables (mass, drag, friction etc.)?

I know that collisions operate on colliders and their shapes, but I am thinking about aerodynamics, gravity and other forces that are counter-applied while objects are in motion.

\$\endgroup\$
  • \$\begingroup\$ I'm not sure for the engines you've mentioned, but I think at least for ODE you can specify an inertia matrix which will be taken into consideration when running the physics simulation. \$\endgroup\$ – Vaillancourt Nov 24 '15 at 22:04
4
\$\begingroup\$

Physics engines for games do not take shape into account for these kinds of calculations, though they can have various bits of data like center of mass and moment of inertia (which help to approximate shape for some uses) used in calculations.

You can somewhat improve things by having complex objects made up of multiple physics bodies held together via constraints, but particularly complex configurations are likely to run into various simulation stability problems.

It is not currently realistic to take shape into account for these calculations for the kinds of of objects and world sizes that general game physics engines handle. If you need a very precise physics simulation for a narrowly-scoped application you can possibly write what you need yourself.

There are very powerful physics libraries available for "professional" simulation in science and military applications that but these are not generally available or even that useful for games.

That said, if you are indeed making a game, you almost certainly don't need as high a level of accuracy as you think. Games are smoke and mirrors. You can apply a lot of tricks to make aerodynamics seem more realistic and meaningful to gameplay without actually needing to do a full fluid sim of the air so long as you properly scope things.

\$\endgroup\$
  • \$\begingroup\$ Ha, thanks! Basically, unwrapped my thoughts - just wanted clarification from an actual pro. \$\endgroup\$ – joltmode Nov 24 '15 at 22:42
  • \$\begingroup\$ @joltmode: well I'm definitely not a physics pro, but I think what I said is accurate anyway. :p \$\endgroup\$ – Sean Middleditch Nov 24 '15 at 23:14

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.