# G Meter

I would like to add a blackout/redout effect to my game. As a result I need to know the current g force load that the pilot is under. I was wondering if anyone had code to compute this or had pointers as to the formula that I would use to create such a g meter?

Many thanks.

Well you have the constant acceleration of the world gravity, the forces applied by joints and any additional acceleration you apply programmatically. Sum them up and you have your g-meter

Ok, ok, that's not easy. You can obtain the forces applied by joints in ODE but I didn't have a look if you can query it via odejava and it is not supported directly by jmephysics. It might even be hard to tell what acceleration you apply programmatically…

So what about an approximation: You can estimate the acceleration applied to the pilot by comparing the velocities of two time steps (as acceleration is the derivative of the velocity). This should give an approximate value as long as you don't have forces in opposite direction and want to know when the vehicle get ripped apart…