diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-03-21 19:38:30 -0400 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2025-03-21 19:38:30 -0400 |
| commit | 00ececa0b583cc7893d37898beab2d2ae3f36b7a (patch) | |
| tree | 5c555b824933896d07e71748f76743538e328abf /include/egg/math/eggRotation.h | |
| parent | b6505d23ad73d1f0a32ef23dd57f85092a0e2745 (diff) | |
Egg Camera a small bit closer
Diffstat (limited to 'include/egg/math/eggRotation.h')
| -rw-r--r-- | include/egg/math/eggRotation.h | 50 |
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 |
