summaryrefslogtreecommitdiff
path: root/indra/llmath/m4math.cpp
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2015-10-01 09:35:58 -0700
committerAura Linden <aura@lindenlab.com>2015-10-01 09:35:58 -0700
commit40316f8431279d925bc677a7e2ef7b4d79bc843a (patch)
tree218b97ae3d0173a9b8c106c09306aef03f42c7f6 /indra/llmath/m4math.cpp
parenta4fef135b110045500d9afc1b558127bc2f5cd89 (diff)
parent6c422a881499c0d7649a59db47905a584bbd2bc1 (diff)
Pulled merge to use xcode 7.
Diffstat (limited to 'indra/llmath/m4math.cpp')
-rwxr-xr-xindra/llmath/m4math.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp
index 6a1b4143cf..d89c482804 100755
--- a/indra/llmath/m4math.cpp
+++ b/indra/llmath/m4math.cpp
@@ -274,6 +274,19 @@ const LLMatrix4& LLMatrix4::invert(void)
return *this;
}
+// Convenience func for simplifying comparison-heavy code by
+// intentionally stomping values in [-FLT_EPS,FLT_EPS] to 0.0f
+//
+void LLMatrix4::condition(void)
+{
+ U32 i;
+ U32 j;
+ for (i = 0; i < 3;i++)
+ for (j = 0; j < 3;j++)
+ mMatrix[i][j] = ((mMatrix[i][j] > -FLT_EPSILON)
+ && (mMatrix[i][j] < FLT_EPSILON)) ? 0.0f : mMatrix[i][j];
+}
+
LLVector4 LLMatrix4::getFwdRow4() const
{
return LLVector4(mMatrix[VX][VX], mMatrix[VX][VY], mMatrix[VX][VZ], mMatrix[VX][VW]);