summaryrefslogtreecommitdiff
path: root/indra/llmath/m4math.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2014-07-07 17:59:07 -0700
committerGraham Linden <graham@lindenlab.com>2014-07-07 17:59:07 -0700
commit76e7f978c157f9921593ea0e43f642cb9de4703d (patch)
treeccc62865f26cb84cabbe9b65de23c4e1342aa142 /indra/llmath/m4math.cpp
parent226929f8f5b8bc1080d0082b2595d689238df2b8 (diff)
parentcf143bd4610dc279f1aa790e0b37fbad5c86f654 (diff)
Merge viewer up to 3.7.12, including fixing missed LL_WARNS etc from last release (is that trout you smell on the air? is it?)
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]);