Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-04-27 13:08:12 +0000
committerStijn Buys <ingar@osirion.org>2008-04-27 13:08:12 +0000
commita4b36e6d1e20b5036d1ed7cf9f61a48dbbf77812 (patch)
tree7efd0048fd8c10b1f04d427c78e3ac8da402f059 /src/math/matrix4f.h
parentfe95954f9d17c9dade1827fe5d4cf8cffffddbce (diff)
3D flight
Diffstat (limited to 'src/math/matrix4f.h')
-rw-r--r--src/math/matrix4f.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/math/matrix4f.h b/src/math/matrix4f.h
new file mode 100644
index 0000000..0d7df90
--- /dev/null
+++ b/src/math/matrix4f.h
@@ -0,0 +1,58 @@
+/*
+ math/matrix4f.cc
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_MATH_MATRIX4F_H__
+#define __INCLUDED_MATH_MATRIX4F_H__
+
+// project headers
+#include "math/axis.h"
+
+// C++ headers
+#include <iostream>
+
+namespace math
+{
+
+/// a transformation matrix
+class Matrix4f
+{
+public:
+ Matrix4f();
+ Matrix4f(const Matrix4f & other);
+ Matrix4f(const Axis & axis);
+
+ /// set all values to zero
+ void clear();
+
+ /// set the value to a 4x4 unity matrix
+ void unity();
+
+ /// assignment operator
+ void assign(const Matrix4f & other);
+
+ /// assignment operator
+ inline Matrix4f & operator=(const Matrix4f &other);
+
+ /// assign the matrix transformation equivalent to the coordinate system
+ void assign(const Axis & axis);
+
+ /// assign the matrix transformation equivalent to the coordinate system
+ Matrix4f & operator=(const Axis & axis);
+
+ /// return a pointer to the internal data
+ inline float * ptr() const { return (float *) matrix; }
+
+ /// return the transpose matrix
+ Matrix4f const transpose();
+
+private:
+ float matrix[4][4];
+};
+
+}
+
+#endif // __INCLUDED_MATH_MATRIX4F_H__
+