diff options
author | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-10-16 02:29:45 +0300 |
---|---|---|
committer | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-10-16 02:29:45 +0300 |
commit | a30a2045f56909586aff5cb74a1e85dd010ad1ae (patch) | |
tree | 9595f6d812a79319e32eca2e83aee9e2defc1ae5 /indra/llmath/m4math.cpp | |
parent | 9a24b487e2e0407d4bde6091eae020acb543b741 (diff) | |
parent | c1e3f778cb377999edf49764088f3f23a2302afc (diff) |
Merge
--HG--
branch : develop
Diffstat (limited to 'indra/llmath/m4math.cpp')
-rwxr-xr-x | indra/llmath/m4math.cpp | 13 |
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]); |