- Joined
- Apr 24, 2012
- Messages
- 5,113
Is this formula how to find the bouncing angle?
[jass=] private function NormalizeAngle takes real angle returns real
local integer a
if (0 > angle) then
set a = R2I(angle*180/bj_PI - 45)/90*90
else
set a = R2I(angle*180/bj_PI + 45)/90*90
endif
if (0 > a or 360 < a) then
set a = a - a/360*360
if (0 > a) then
set a = a + 360
endif
endif
return a/180.*bj_PI[/code]
It is Nest's Code from is path blocked
[jass=] private function NormalizeAngle takes real angle returns real
local integer a
if (0 > angle) then
set a = R2I(angle*180/bj_PI - 45)/90*90
else
set a = R2I(angle*180/bj_PI + 45)/90*90
endif
if (0 > a or 360 < a) then
set a = a - a/360*360
if (0 > a) then
set a = a + 360
endif
endif
return a/180.*bj_PI[/code]
It is Nest's Code from is path blocked