Fixed atan2.

This commit is contained in:
Branimir Karadžić
2018-04-23 16:22:14 -07:00
parent 2dc2137905
commit 7a05d19352
2 changed files with 8 additions and 0 deletions

View File

@@ -124,6 +124,12 @@ namespace bx
const float ay = abs(_y);
const float maxaxy = max(ax, ay);
const float minaxy = min(ax, ay);
if (maxaxy == 0.0f)
{
return 0.0f*sign(_y);
}
const float mxy = minaxy / maxaxy;
const float mxysq = square(mxy);
const float tmp0 = mad(kAtan2C0, mxysq, kAtan2C1);