I am trying to make a 2d top down game, where you control a ship in an environment governed by gravity. Like the flash game gravity actually.
I use applyForce locally to give the ship thrust in four directions, forward and backward, left and right. Also I use applyTorque to rotate the ship so thrust can be applied in any direction needed.
My problem starts with trying to reduce velocity to zero to stabilize the position of the craft. The problem I’m running into is that the getVelocity function gets the global velocity of the object, not the local relative to the rotation of the object. So while it works fine if the ship is never rotated, it begins to behave very strangley when it is rotated. Due entirely to local Force being applied versus the Global reference vector.
Is there a way to get the Local velocity of an Object?