summaryrefslogtreecommitdiffstats
path: root/debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-09-11 14:38:47 +0900
committerMichele Calgaro <[email protected]>2020-09-11 14:38:47 +0900
commit884c8093d63402a1ad0b502244b791e3c6782be3 (patch)
treea600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx
parent14e1aa2006796f147f3f4811fb908a6b01e79253 (diff)
downloadextra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz
extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx')
-rw-r--r--debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx52
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx b/debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx
new file mode 100644
index 00000000..d8483017
--- /dev/null
+++ b/debian/fireflies/fireflies-2.08/libgfx/src/symmat4.cxx
@@ -0,0 +1,52 @@
+/************************************************************************
+
+ 4X4 Symmetric Matrix class
+
+ $Id: symmat4.cxx 427 2004-09-27 04:45:31Z garland $
+
+ ************************************************************************/
+#include <gfx/symmat4.h>
+
+namespace gfx
+{
+
+SymMat4 SymMat4::I()
+{
+ SymMat4 A;
+ A(0,0) = A(1,1) = A(2,2) = A(3,3) = 1;
+ return A;
+}
+
+Mat4 SymMat4::fullmatrix() const
+{
+ Mat4 temp;
+ for (int i=0; i<4; i++)
+ for (int j=0; j<4; j++)
+ temp(i,j) = (*this) (i,j);
+ return temp;
+}
+
+SymMat4 SymMat4::outer_product(const Vec4& v)
+{
+ SymMat4 tmp;
+ for(int i=0; i<4; i++)
+ for(int j=0; j<4; j++)
+ tmp(i,j)=v[i]*v[j];
+ return tmp;
+}
+
+SymMat4 operator* (const SymMat4& n, const SymMat4& m)
+{
+ SymMat4 temp;
+ for (int i=0; i<4; i++)
+ for(int j=0; j<4; j++)
+ temp(i,j)=n.row(i) * m.col(j);
+ return temp;
+}
+
+double invert(Mat4& m_inv, const SymMat4& m)
+{
+ return invert(m_inv, m.fullmatrix());
+}
+
+} // namespace gfx