summaryrefslogtreecommitdiff
path: root/indra/llmath/m4math.h
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2011-02-22 14:48:32 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2011-02-22 14:48:32 -0500
commit5c9ea3265408a4a18805a057d7934259b3a50ca1 (patch)
tree88b88204245e72beeac9a3286e4bc142ad00cef7 /indra/llmath/m4math.h
parentad2c986098954096161406fccccfb7eec3729a81 (diff)
parentb53ffe4eae9700ad78f01cfec3458b5611330027 (diff)
merge
Diffstat (limited to 'indra/llmath/m4math.h')
-rw-r--r--indra/llmath/m4math.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h
index 10c88464e5..3588f36758 100644
--- a/indra/llmath/m4math.h
+++ b/indra/llmath/m4math.h
@@ -132,6 +132,7 @@ public:
// various useful matrix functions
const LLMatrix4& setIdentity(); // Load identity matrix
+ bool isIdentity() const;
const LLMatrix4& setZero(); // Clears matrix to all zeros.
const LLMatrix4& initRotation(const F32 angle, const F32 x, const F32 y, const F32 z); // Calculate rotation matrix by rotating angle radians about (x, y, z)
@@ -262,6 +263,30 @@ inline const LLMatrix4& LLMatrix4::setIdentity()
return (*this);
}
+inline bool LLMatrix4::isIdentity() const
+{
+ return
+ mMatrix[0][0] == 1.f &&
+ mMatrix[0][1] == 0.f &&
+ mMatrix[0][2] == 0.f &&
+ mMatrix[0][3] == 0.f &&
+
+ mMatrix[1][0] == 0.f &&
+ mMatrix[1][1] == 1.f &&
+ mMatrix[1][2] == 0.f &&
+ mMatrix[1][3] == 0.f &&
+
+ mMatrix[2][0] == 0.f &&
+ mMatrix[2][1] == 0.f &&
+ mMatrix[2][2] == 1.f &&
+ mMatrix[2][3] == 0.f &&
+
+ mMatrix[3][0] == 0.f &&
+ mMatrix[3][1] == 0.f &&
+ mMatrix[3][2] == 0.f &&
+ mMatrix[3][3] == 1.f;
+}
+
/*
inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b)