Prevent division by zero in CalcFov().

This commit is contained in:
Marcus Sundberg 2000-02-05 16:03:37 +00:00
parent 6403d62a28
commit 2cb28b8f01
2 changed files with 2 additions and 2 deletions

View file

@ -268,7 +268,7 @@ float CalcFov (float fov_x, float width, float height)
x = width/tan(fov_x/360*M_PI); x = width/tan(fov_x/360*M_PI);
a = atan (height/x); a = (x == 0) ? 90 : atan(height/x);
a = a*360/M_PI; a = a*360/M_PI;

View file

@ -273,7 +273,7 @@ float CalcFov (float fov_x, float width, float height)
x = width/tan(fov_x/360*M_PI); x = width/tan(fov_x/360*M_PI);
a = atan (height/x); a = (x == 0) ? 90 : atan(height/x);
a = a*360/M_PI; a = a*360/M_PI;