summaryrefslogtreecommitdiff
path: root/indra/llmath/v4math.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-10 20:03:54 +0300
committerGitHub <noreply@github.com>2024-06-10 20:03:54 +0300
commitf74c10c4ec6435471bac84473fe865f90843c2df (patch)
treeb2853d87789dbb84d6c26c259eab6639d3a7e482 /indra/llmath/v4math.cpp
parent5fccb539937a52d286274a002266e022e2102e5e (diff)
parent32fcefc058ae38eff0572326ef3efd1c7b343144 (diff)
Merge branch 'DRTVWR-600-maint-A' into signal/trim-trailing
Diffstat (limited to 'indra/llmath/v4math.cpp')
-rw-r--r--indra/llmath/v4math.cpp42
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;
}