summaryrefslogtreecommitdiff
path: root/indra/llmath/m4math.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-09-29 15:24:03 -0400
committerOz Linden <oz@lindenlab.com>2015-09-29 15:24:03 -0400
commit9757c3a7fa1c67ecbf62df4493dc68040ba0e264 (patch)
tree1d3ec613c44b1c91b2ee91546be7be0de9c72f6e /indra/llmath/m4math.cpp
parent453dee2d21477ad534fa9982b844c40adde9b93e (diff)
parent2d52b62e67cf46222396c724d00d2de874819197 (diff)
merge changes for 3.8.4-release
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]);