I've finally reached a perfect solution, although I can't say this code is as efficient as can be. The real problem ended up the different way rotations were being stored. For the entities rotation, it run counterclockwise 0-360. The result of atan2 gave me something running clockwise and -180-180. The key turned out to be converting to counterclockwise 0-360, after which it was a trivial solution, although code posted earlier on here helped out, particulary in ensuring there isn't jerky movement when the entity is pointing towards the ship out by only a fraction of a degree.
I'm not sure if this solution would apply to anyone else's code, but hopefully it could be of help to somebody. Either way, there is plenty of reading material on this post, and I'd like to thank everybody who contributed and helped solve my issue!
1 2 3 4 5 6 7 8 9 10 11 12 | playerAngle = (float) (Math.toDegrees((MathUtils.atan2(player.y-y, player.x-x)))+270)%360; |