diff options
author | callum_linden <none@none> | 2015-09-29 13:03:51 -0700 |
---|---|---|
committer | callum_linden <none@none> | 2015-09-29 13:03:51 -0700 |
commit | 11c188dc734fd1dc921a2fa4c14e89a0e190c26b (patch) | |
tree | 3b2f16cdc2ebfcc30d30a28030a9aafb6eae0c58 /indra/llmath/m4math.cpp | |
parent | 3e20770f350652b91fd4b4a5bbef9b5f03561310 (diff) | |
parent | 2d52b62e67cf46222396c724d00d2de874819197 (diff) |
Merge with viewer-release (DRTVWR-368)
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]); |