summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2014-12-19 23:18:21 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2014-12-19 23:18:21 +0200
commit7869b9a73d7df71764ddbc247ab1a684190e247b (patch)
tree98f5e1b7810554364d0a4c6be43477cbbb8bc052 /indra/llmath
parent8f02cb4d09a8ef4849672499a2f95d3648f2a47f (diff)
parent4ec9bce3c2a715f53938e4568c95b7a2bdfc9e16 (diff)
merge changes of 3.7.23-release
Diffstat (limited to 'indra/llmath')
-rwxr-xr-xindra/llmath/llquaternion.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h
index e56929ed0f..aa0b1752f4 100755
--- a/indra/llmath/llquaternion.h
+++ b/indra/llmath/llquaternion.h
@@ -71,6 +71,9 @@ public:
void quantize8(F32 lower, F32 upper); // changes the vector to reflect quatization
void loadIdentity(); // Loads the quaternion that represents the identity rotation
+ bool isEqualEps(const LLQuaternion &quat, F32 epsilon) const;
+ bool isNotEqualEps(const LLQuaternion &quat, F32 epsilon) const;
+
const LLQuaternion& set(F32 x, F32 y, F32 z, F32 w); // Sets Quaternion to normalize(x, y, z, w)
const LLQuaternion& set(const LLQuaternion &quat); // Copies Quaternion
const LLQuaternion& set(const F32 *q); // Sets Quaternion to normalize(quat[VX], quat[VY], quat[VZ], quat[VW])
@@ -239,6 +242,21 @@ inline void LLQuaternion::loadIdentity()
mQ[VW] = 1.0f;
}
+inline bool LLQuaternion::isEqualEps(const LLQuaternion &quat, F32 epsilon) const
+{
+ return ( fabs(mQ[VX] - quat.mQ[VX]) < epsilon
+ && fabs(mQ[VY] - quat.mQ[VY]) < epsilon
+ && fabs(mQ[VZ] - quat.mQ[VZ]) < epsilon
+ && fabs(mQ[VS] - quat.mQ[VS]) < epsilon );
+}
+
+inline bool LLQuaternion::isNotEqualEps(const LLQuaternion &quat, F32 epsilon) const
+{
+ return ( fabs(mQ[VX] - quat.mQ[VX]) > epsilon
+ || fabs(mQ[VY] - quat.mQ[VY]) > epsilon
+ || fabs(mQ[VZ] - quat.mQ[VZ]) > epsilon
+ || fabs(mQ[VS] - quat.mQ[VS]) > epsilon );
+}
inline const LLQuaternion& LLQuaternion::set(F32 x, F32 y, F32 z, F32 w)
{