diff options
Diffstat (limited to 'source/modules/asura-utils/math')
-rw-r--r-- | source/modules/asura-utils/math/matrix44.cpp | 7 | ||||
-rw-r--r-- | source/modules/asura-utils/math/matrix44.h | 2 | ||||
-rw-r--r-- | source/modules/asura-utils/math/rect.hpp | 2 | ||||
-rw-r--r-- | source/modules/asura-utils/math/rect.inl | 9 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector2.hpp | 2 |
5 files changed, 22 insertions, 0 deletions
diff --git a/source/modules/asura-utils/math/matrix44.cpp b/source/modules/asura-utils/math/matrix44.cpp index a1dc933..4472cd8 100644 --- a/source/modules/asura-utils/math/matrix44.cpp +++ b/source/modules/asura-utils/math/matrix44.cpp @@ -185,6 +185,13 @@ namespace AsuraEngine this->operator *=(t); } + void Matrix44::Ortho(float left, float right, float bottom, float top, float near, float far) + { + Matrix44 t; + t.SetOrtho(left, right, bottom, top, near, far); + this->operator *=(t); + } + // | x | // | y | // | 0 | diff --git a/source/modules/asura-utils/math/matrix44.h b/source/modules/asura-utils/math/matrix44.h index 9ff0288..addee98 100644 --- a/source/modules/asura-utils/math/matrix44.h +++ b/source/modules/asura-utils/math/matrix44.h @@ -61,6 +61,8 @@ namespace AsuraEngine /// void Shear(float kx, float ky); + void Ortho(float left, float right, float bottom, float top, float near, float far); + ///// ///// Transforms an array of vertices by this Matrix44. The sources and ///// destination arrays may be the same. diff --git a/source/modules/asura-utils/math/rect.hpp b/source/modules/asura-utils/math/rect.hpp index 15981c2..010a5db 100644 --- a/source/modules/asura-utils/math/rect.hpp +++ b/source/modules/asura-utils/math/rect.hpp @@ -29,6 +29,8 @@ namespace AsuraEngine /// static bool Intersect(const Rect<T>& src1, const Rect<T>& src2, Rect<T>& intersection); + void Set(T x, T y, T w, T h); + T x, y, w, h; }; diff --git a/source/modules/asura-utils/math/rect.inl b/source/modules/asura-utils/math/rect.inl index 891a3f8..efafbf9 100644 --- a/source/modules/asura-utils/math/rect.inl +++ b/source/modules/asura-utils/math/rect.inl @@ -17,3 +17,12 @@ inline Rect<T>::Rect(T X, T Y, T W, T H) { } + +template <typename T> +void Rect<T>::Set(T X, T Y, T W, T H) +{ + x = X; + y = Y; + w = W; + h = H; +}
\ No newline at end of file diff --git a/source/modules/asura-utils/math/vector2.hpp b/source/modules/asura-utils/math/vector2.hpp index 4baf132..e18bbdf 100644 --- a/source/modules/asura-utils/math/vector2.hpp +++ b/source/modules/asura-utils/math/vector2.hpp @@ -67,4 +67,6 @@ namespace AsuraEngine } } +namespace AEMath = AsuraEngine::Math; + #endif
\ No newline at end of file |