isfacingpoint - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Design (/forum-5.html)
+--- Thread: isfacingpoint (/thread-7524.html)
isfacingpoint - skyhawk - Oct 19, 2002 03:42 PM
// returns if unit is facing within a degrees of point
//angle that the object is facing, where to face, within how many degrees
//bob includes x and y positions and directions and other things if you want to assume
char isfacingpoint(OT *bob,float xpos,float ypos,int degrees)
any quick(or even non quick) ways to do this? It has been troubling my brain all afternoon
isfacingpoint - Jeff Binder - Oct 19, 2002 07:40 PM
Perhaps something like this:
This assumes that bob.angle is measured in the counter-clockwise direction off the positive x axis. Otherwise you may have to flip some coordinates or add something to the angle.
EDIT: oops, I meant counter-clockwise.