diff options
Diffstat (limited to 'indra/llmath/v4math.cpp')
-rw-r--r-- | indra/llmath/v4math.cpp | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/indra/llmath/v4math.cpp b/indra/llmath/v4math.cpp index 8955145527..0aa6eb09c3 100644 --- a/indra/llmath/v4math.cpp +++ b/indra/llmath/v4math.cpp @@ -36,28 +36,6 @@ // LLVector4 // Axis-Angle rotations - -/* -const LLVector4& LLVector4::rotVec(F32 angle, const LLVector4 &vec) -{ - if ( !vec.isExactlyZero() && angle ) - { - *this = *this * LLMatrix4(angle, vec); - } - return *this; -} - -const LLVector4& LLVector4::rotVec(F32 angle, F32 x, F32 y, F32 z) -{ - LLVector3 vec(x, y, z); - if ( !vec.isExactlyZero() && angle ) - { - *this = *this * LLMatrix4(angle, vec); - } - return *this; -} -*/ - const LLVector4& LLVector4::rotVec(const LLMatrix4 &mat) { *this = *this * mat; @@ -81,15 +59,15 @@ const LLVector4& LLVector4::scaleVec(const LLVector4& vec) } // Sets all values to absolute value of their original values -// Returns TRUE if data changed -BOOL LLVector4::abs() +// Returns true if data changed +bool LLVector4::abs() { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = TRUE; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = TRUE; } - if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = TRUE; } - if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = TRUE; } + if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } + if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } + if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; } + if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = true; } return ret; } @@ -117,7 +95,7 @@ F32 angle_between( const LLVector4& a, const LLVector4& b ) return angle; } -BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) +bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) { LLVector4 an = a; LLVector4 bn = b; @@ -125,8 +103,8 @@ BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) bn.normalize(); F32 dot = an * bn; if ( (1.0f - fabs(dot)) < epsilon) - return TRUE; - return FALSE; + return true; + return false; } |