07-02-2016, 07:44 PM
It's something similar to this (untested, may not work as I wrote it from memory):
Code:
float object::direction(point pos)
{
float x = atan2(pos.y-this.position.y, pos.x-this.position.x)-this.orientation;
if (x > 180) x = x-360;
return x;
}