I'm trying to rotate an object so it's facing the way it's moving.

Is there a function in jPCT or Java that can calculate the rotation angle based on an object's translation movement?

If the object is travelling up Z using translation(0,0,2), the angle would be 270 degrees.

If the object is travelling down Z using translation(0,0,-2), the angle would be 90 degrees (or PI/2).

If the object is travelling up X using translation(2,0,0), the angle would be 0 degrees.

If the object is travelling down X using translation(-2,0,0), the angle would be 180 degrees (or PI).

If the object is travelling down X and up Z using translation(-2,0,2), the angle would be 225 (270-180).