summaryrefslogtreecommitdiff
path: root/indra/llmath/llmatrix4a.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath/llmatrix4a.h')
-rw-r--r--indra/llmath/llmatrix4a.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h
index 348feba27e..3b423f783a 100644
--- a/indra/llmath/llmatrix4a.h
+++ b/indra/llmath/llmatrix4a.h
@@ -46,6 +46,34 @@ public:
loadu(val);
}
+ explicit LLMatrix4a(const F32* val)
+ {
+ loadu(val);
+ }
+
+ static const LLMatrix4a& identity()
+ {
+ static const F32 v[] =
+ { 1.f, 0.f, 0.f, 0.f,
+ 0.f, 1.f, 0.f, 0.f,
+ 0.f, 0.f, 1.f, 0.f,
+ 0.f, 0.f, 0.f, 1.f
+ };
+ static LLMatrix4a identity_mat(v);
+
+ return identity_mat;
+ }
+
+ bool operator==(const LLMatrix4a& rhs) const
+ {
+ return mMatrix[0] == rhs.mMatrix[0] && mMatrix[1] == rhs.mMatrix[1] && mMatrix[2] == rhs.mMatrix[2] && mMatrix[3] == rhs.mMatrix[3];
+ }
+
+ bool operator!=(const LLMatrix4a& rhs) const
+ {
+ return !(*this == rhs);
+ }
+
inline F32* getF32ptr()
{
return (F32*) &mMatrix;
@@ -56,6 +84,16 @@ public:
return (F32*)&mMatrix;
}
+ inline LLMatrix4& asMatrix4()
+ {
+ return *(LLMatrix4*)this;
+ }
+
+ inline const LLMatrix4& asMatrix4() const
+ {
+ return *(LLMatrix4*)this;
+ }
+
inline void clear()
{
mMatrix[0].clear();