From 8f3d288fa8663777063c5d460a7b08a8a78d47e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 2 Jan 2017 19:01:57 -0800 Subject: [PATCH] Cleanup. --- include/bx/fpumath.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index c7438eb..9b951a7 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -132,6 +132,11 @@ namespace bx return acosf(_a); } + inline float fatan2(float _y, float _x) + { + return atan2f(_y, _x); + } + inline float fpow(float _a, float _b) { return powf(_a, _b); @@ -492,9 +497,9 @@ namespace bx const float zz = z * z; const float xx = x * x; - _result[0] = atan2f(2.0f * (x * w - y * z), 1.0f - 2.0f * (xx + zz) ); - _result[1] = atan2f(2.0f * (y * w + x * z), 1.0f - 2.0f * (yy + zz) ); - _result[2] = asinf (2.0f * (x * y + z * w) ); + _result[0] = fatan2(2.0f * (x * w - y * z), 1.0f - 2.0f * (xx + zz) ); + _result[1] = fatan2(2.0f * (y * w + x * z), 1.0f - 2.0f * (yy + zz) ); + _result[2] = fasin (2.0f * (x * y + z * w) ); } inline void quatRotateAxis(float* __restrict _result, const float* _axis, float _angle)