Since you Only need to know if it is facing the right way:jph_wacheski wrote: another thing that I am interested in for AI is sight lines,. so any similarly optomised maths for finding if an object in range is facing (with in 90 degrees say) towards the other object??
angle_bot_to_player = atan2(player.Y-bot.Y,player.X-bot.X);
bot_facing_angle = ??? depends how is your config. It might be as simple as "bot.rotate.z". However you should already know this!
to know if it is in "sight": (abs(angle_bot_to_player - bot_facing_angle) < pi/8).
Just make sure you do not get some problems with the "step" that is there between (-180°) and 180°. If you send me a zproj file I will implement this in no time