diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-08-13 15:32:47 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-08-13 15:32:47 -0400 |
commit | 23f2631d598b6e07450a96ed1ec00670c8867cdd (patch) | |
tree | 20195c1688ad8cb7e8631c97fa5920624f10972c /indra/llmath/v4math.cpp | |
parent | 54334ff6e377e35c97df3a0fe2a859795ec07b21 (diff) | |
parent | 8ce3323269d95f54e2b768c4c5aa154d4afbbb6b (diff) |
Merge branch 'develop' into nat/edu-channel
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; } |