Skip to main content
gamedev.net
🔒 Locked

Angle redirection

Started by TheShadow Apr 25, 2003 at 2:17 PM 6 replies 350+ views
Original Post
TheShadow
TheShadow
Is this the best formula for in game angle redirection... Y = abs( d + (180 - 2d) ) where d is my original angle.... Its what i came up with after looking at the problem [edited by - TheShadow on April 25, 2003 3:26:50 PM]
Mecha Engineer (Making Real Humanoid Suits)
Dobbs
Dobbs
What do you mean by in game angle redirection? It looks vaguely like you''re trying to determine the angle of something bouncing off a surface, is that it?
TheShadow
TheShadow
Yes... like a wall collision sorry for that...
Mecha Engineer (Making Real Humanoid Suits)
TheShadow
TheShadow
I got some trouble with it

it works only for angles lower than 45 and greater than 135... i got this formula with geometry...
Mecha Engineer (Making Real Humanoid Suits)
Sneftel
Sneftel
If d is the angle from the surface normal:

Y = -d

If d is the angle from a line parallel to the surface:

Y = 180 - d


How appropriate. You fight like a cow.
TheShadow
TheShadow
That would give me same values for example


Y = | 180 - 135 | = | 180 - 225 |
Mecha Engineer (Making Real Humanoid Suits)
Sneftel
Sneftel
Why are you so fond of absolute values? You don''t want them here.

Negative angles are perfectly common and acceptable math. If you don''t like them, add 360. Don''t do abs. I''ll say it again: don''t do abs. It doesn''t do what you want it to do.


How appropriate. You fight like a cow.
TheShadow
TheShadow
I think d - 180 does the job best thank u
will use negatives
Mecha Engineer (Making Real Humanoid Suits)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.