summaryrefslogtreecommitdiff
path: root/include/egg/math/eggRotation.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/egg/math/eggRotation.h')
-rw-r--r--include/egg/math/eggRotation.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/egg/math/eggRotation.h b/include/egg/math/eggRotation.h
new file mode 100644
index 00000000..97910e97
--- /dev/null
+++ b/include/egg/math/eggRotation.h
@@ -0,0 +1,50 @@
+#ifndef EGG_ROTATION_H
+#define EGG_ROTATION_H
+
+#include "egg/math/eggMath.h"
+
+namespace EGG {
+
+template <typename T>
+struct Rotation {
+ Rotation() {}
+ Rotation(T val) : mRot(val) {}
+ Rotation(const Rotation &other) {
+ mRot = other.mRot;
+ }
+ Rotation &operator=(const Rotation &other) {
+ mRot = val;
+ return *this;
+ }
+ Rotation &operator=(T val) {
+ mRot = val;
+ return *this;
+ }
+
+ operator T() const {
+ return mRot;
+ }
+
+ Rotation &operator-=(T val) {
+ mRot -= val;
+ return *this;
+ }
+ Rotation &operator+=(T val) {
+ mRot -= val;
+ return *this;
+ }
+
+ const T cos() const {
+ return Math<T>::cos(*this);
+ }
+ const T sin() const {
+ return Math<T>::sin(*this);
+ }
+
+protected:
+ T mRot;
+};
+
+} // namespace EGG
+
+#endif