Jump to content
• Advertisement

#### Archived

This topic is now archived and is closed to further replies.

# isfacingpoint

This topic is 5752 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

// returns if unit is facing within (degrees) 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 [edited by - Raging Teen on October 19, 2002 7:14:28 PM]

#### Share this post

##### Share on other sites
Advertisement
I''m not sure what you mean. Do you want to find the angle between two vectors? Use the dot product for that.

Cédric

#### Share this post

##### Share on other sites
no no no, I''ve reduced the problem down to I have 2 angles now between +180 and -180 off the x axis and I want to know whether they are within X degrees of each other.

#### Share this post

##### Share on other sites
Uh...

|angle1 - angle2| < x

?

Cédric

#### Share this post

##### Share on other sites
|angle1 - angle2| < x OR 360 - |angle1 - angle2| < x

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5
• Advertisement

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002131
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!