diff options
author | chai <chaifix@163.com> | 2019-08-02 20:51:00 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-02 20:51:00 +0800 |
commit | bad78945ceba425f6a80e3b8dca2414d592970eb (patch) | |
tree | 8bf7540766349c534bf9e5746b24fd7507ba034e /source/modules/asura-utils/math | |
parent | 99b90496765df21c5f377f42b9ed073ccb34c1fd (diff) |
*修改文件名格式
Diffstat (limited to 'source/modules/asura-utils/math')
-rw-r--r-- | source/modules/asura-utils/math/matrix44.cpp | 2 | ||||
-rw-r--r-- | source/modules/asura-utils/math/matrix44.h | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/ranged_value.cpp | 0 | ||||
-rw-r--r-- | source/modules/asura-utils/math/ranged_value.h | 0 | ||||
-rw-r--r-- | source/modules/asura-utils/math/rect.hpp | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/rect.inl | 28 | ||||
-rw-r--r-- | source/modules/asura-utils/math/transform.h | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector2.hpp | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector2.inl | 114 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector3.hpp | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector3.inl | 145 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector4.h | 6 | ||||
-rw-r--r-- | source/modules/asura-utils/math/vector4.inl | 152 |
13 files changed, 19 insertions, 458 deletions
diff --git a/source/modules/asura-utils/math/matrix44.cpp b/source/modules/asura-utils/math/matrix44.cpp index 4472cd8..9ecf448 100644 --- a/source/modules/asura-utils/math/matrix44.cpp +++ b/source/modules/asura-utils/math/matrix44.cpp @@ -1,4 +1,4 @@ -#include "matrix44.h" +#include "Matrix44.h" #include <cstring> // memcpy #include <cmath> diff --git a/source/modules/asura-utils/math/matrix44.h b/source/modules/asura-utils/math/matrix44.h index 30033c5..7b66920 100644 --- a/source/modules/asura-utils/math/matrix44.h +++ b/source/modules/asura-utils/math/matrix44.h @@ -1,7 +1,7 @@ -#ifndef __ASURA_MATRIX_H__ -#define __ASURA_MATRIX_H__ +#ifndef _ASURA_MATRIX_H_ +#define _ASURA_MATRIX_H_ -#include "../scripting/portable.hpp" +#include "../Scripting/Portable.hpp" namespace AsuraEngine { diff --git a/source/modules/asura-utils/math/ranged_value.cpp b/source/modules/asura-utils/math/ranged_value.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/modules/asura-utils/math/ranged_value.cpp +++ /dev/null diff --git a/source/modules/asura-utils/math/ranged_value.h b/source/modules/asura-utils/math/ranged_value.h deleted file mode 100644 index e69de29..0000000 --- a/source/modules/asura-utils/math/ranged_value.h +++ /dev/null diff --git a/source/modules/asura-utils/math/rect.hpp b/source/modules/asura-utils/math/rect.hpp index 010a5db..45bf1ba 100644 --- a/source/modules/asura-utils/math/rect.hpp +++ b/source/modules/asura-utils/math/rect.hpp @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_RECT_H__ -#define __ASURA_ENGINE_RECT_H__ +#ifndef _ASURA_ENGINE_RECT_H_ +#define _ASURA_ENGINE_RECT_H_ namespace AsuraEngine { @@ -34,7 +34,7 @@ namespace AsuraEngine T x, y, w, h; }; -#include "Rect.inl" +#include "Rect.inc" // Define the most common types typedef Rect<int> Recti; diff --git a/source/modules/asura-utils/math/rect.inl b/source/modules/asura-utils/math/rect.inl deleted file mode 100644 index efafbf9..0000000 --- a/source/modules/asura-utils/math/rect.inl +++ /dev/null @@ -1,28 +0,0 @@ -template <typename T> -inline Rect<T>::Rect() - : x(0) - , y(0) - , w(0) - , h(0) -{ - -} - -template <typename T> -inline Rect<T>::Rect(T X, T Y, T W, T H) - : x(X) - , y(Y) - , w(W) - , h(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/transform.h b/source/modules/asura-utils/math/transform.h index be4c850..23d0709 100644 --- a/source/modules/asura-utils/math/transform.h +++ b/source/modules/asura-utils/math/transform.h @@ -1,7 +1,7 @@ -#ifndef __ASURA_ENGINE_TRANSFORM_H__ -#define __ASURA_ENGINE_TRANSFORM_H__ +#ifndef _ASURA_ENGINE_TRANSFORM_H_ +#define _ASURA_ENGINE_TRANSFORM_H_ -#include "../scripting/portable.hpp" +#include "../scripting/Portable.hpp" namespace AsuraEngine { diff --git a/source/modules/asura-utils/math/vector2.hpp b/source/modules/asura-utils/math/vector2.hpp index e18bbdf..f2405eb 100644 --- a/source/modules/asura-utils/math/vector2.hpp +++ b/source/modules/asura-utils/math/vector2.hpp @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_VECTOR2_H__ -#define __ASURA_ENGINE_VECTOR2_H__ +#ifndef _ASURA_ENGINE_VECTOR2_H__ +#define _ASURA_ENGINE_VECTOR2_H__ namespace AsuraEngine { @@ -57,7 +57,7 @@ namespace AsuraEngine template <typename T> bool operator !=(const Vector2<T>& left, const Vector2<T>& right); -#include "Vector2.inl" +#include "Vector2.inc" // Define the most common types typedef Vector2<int> Vector2i; diff --git a/source/modules/asura-utils/math/vector2.inl b/source/modules/asura-utils/math/vector2.inl deleted file mode 100644 index 155432a..0000000 --- a/source/modules/asura-utils/math/vector2.inl +++ /dev/null @@ -1,114 +0,0 @@ -template <typename T> -inline Vector2<T>::Vector2() : - x(0), - y(0) -{ - -} - -template <typename T> -inline Vector2<T>::Vector2(T X, T Y) : - x(X), - y(Y) -{ - -} - -template <typename T> -template <typename U> -inline Vector2<T>::Vector2(const Vector2<U>& vector) : - x(static_cast<T>(vector.x)), - y(static_cast<T>(vector.y)) -{ -} - -template <typename T> -inline void Vector2<T>::Set(T X, T Y) -{ - x = X; - y = Y; -} - -template <typename T> -inline Vector2<T> operator -(const Vector2<T>& right) -{ - return Vector2<T>(-right.x, -right.y); -} - -template <typename T> -inline Vector2<T>& operator +=(Vector2<T>& left, const Vector2<T>& right) -{ - left.x += right.x; - left.y += right.y; - - return left; -} - -template <typename T> -inline Vector2<T>& operator -=(Vector2<T>& left, const Vector2<T>& right) -{ - left.x -= right.x; - left.y -= right.y; - - return left; -} - -template <typename T> -inline Vector2<T> operator +(const Vector2<T>& left, const Vector2<T>& right) -{ - return Vector2<T>(left.x + right.x, left.y + right.y); -} - -template <typename T> -inline Vector2<T> operator -(const Vector2<T>& left, const Vector2<T>& right) -{ - return Vector2<T>(left.x - right.x, left.y - right.y); -} - -template <typename T> -inline Vector2<T> operator *(const Vector2<T>& left, T right) -{ - return Vector2<T>(left.x * right, left.y * right); -} - -template <typename T> -inline Vector2<T> operator *(T left, const Vector2<T>& right) -{ - return Vector2<T>(right.x * left, right.y * left); -} - -template <typename T> -inline Vector2<T>& operator *=(Vector2<T>& left, T right) -{ - left.x *= right; - left.y *= right; - - return left; -} - -template <typename T> -inline Vector2<T> operator /(const Vector2<T>& left, T right) -{ - return Vector2<T>(left.x / right, left.y / right); -} - -template <typename T> -inline Vector2<T>& operator /=(Vector2<T>& left, T right) -{ - left.x /= right; - left.y /= right; - - return left; -} - -template <typename T> -inline bool operator ==(const Vector2<T>& left, const Vector2<T>& right) -{ - return (left.x == right.x) && (left.y == right.y); -} - -template <typename T> -inline bool operator !=(const Vector2<T>& left, const Vector2<T>& right) -{ - return (left.x != right.x) || (left.y != right.y); -} diff --git a/source/modules/asura-utils/math/vector3.hpp b/source/modules/asura-utils/math/vector3.hpp index 2b23406..8da57cf 100644 --- a/source/modules/asura-utils/math/vector3.hpp +++ b/source/modules/asura-utils/math/vector3.hpp @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_VECTOR3_H__ -#define __ASURA_ENGINE_VECTOR3_H__ +#ifndef _ASURA_ENGINE_VECTOR3_H__ +#define _ASURA_ENGINE_VECTOR3_H__ namespace AsuraEngine { @@ -221,7 +221,7 @@ namespace AsuraEngine template <typename T> bool operator !=(const Vector3<T>& left, const Vector3<T>& right); -#include "Vector3.inl" +#include "Vector3.inc" // Define the most common types typedef Vector3<int> Vector3i; diff --git a/source/modules/asura-utils/math/vector3.inl b/source/modules/asura-utils/math/vector3.inl deleted file mode 100644 index 3a2aa93..0000000 --- a/source/modules/asura-utils/math/vector3.inl +++ /dev/null @@ -1,145 +0,0 @@ - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>::Vector3() : - x(0), - y(0), - z(0) -{ - -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>::Vector3(T X, T Y, T Z) : - x(X), - y(Y), - z(Z) -{ - -} - - -//////////////////////////////////////////////////////////// -template <typename T> -template <typename U> -inline Vector3<T>::Vector3(const Vector3<U>& vector) : - x(static_cast<T>(vector.x)), - y(static_cast<T>(vector.y)), - z(static_cast<T>(vector.z)) -{ -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator -(const Vector3<T>& left) -{ - return Vector3<T>(-left.x, -left.y, -left.z); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>& operator +=(Vector3<T>& left, const Vector3<T>& right) -{ - left.x += right.x; - left.y += right.y; - left.z += right.z; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>& operator -=(Vector3<T>& left, const Vector3<T>& right) -{ - left.x -= right.x; - left.y -= right.y; - left.z -= right.z; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator +(const Vector3<T>& left, const Vector3<T>& right) -{ - return Vector3<T>(left.x + right.x, left.y + right.y, left.z + right.z); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator -(const Vector3<T>& left, const Vector3<T>& right) -{ - return Vector3<T>(left.x - right.x, left.y - right.y, left.z - right.z); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator *(const Vector3<T>& left, T right) -{ - return Vector3<T>(left.x * right, left.y * right, left.z * right); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator *(T left, const Vector3<T>& right) -{ - return Vector3<T>(right.x * left, right.y * left, right.z * left); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>& operator *=(Vector3<T>& left, T right) -{ - left.x *= right; - left.y *= right; - left.z *= right; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T> operator /(const Vector3<T>& left, T right) -{ - return Vector3<T>(left.x / right, left.y / right, left.z / right); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector3<T>& operator /=(Vector3<T>& left, T right) -{ - left.x /= right; - left.y /= right; - left.z /= right; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline bool operator ==(const Vector3<T>& left, const Vector3<T>& right) -{ - return (left.x == right.x) && (left.y == right.y) && (left.z == right.z); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline bool operator !=(const Vector3<T>& left, const Vector3<T>& right) -{ - return (left.x != right.x) || (left.y != right.y) || (left.z != right.z); -} diff --git a/source/modules/asura-utils/math/vector4.h b/source/modules/asura-utils/math/vector4.h index 13a9d8a..a5bf549 100644 --- a/source/modules/asura-utils/math/vector4.h +++ b/source/modules/asura-utils/math/vector4.h @@ -1,5 +1,5 @@ -#ifndef __ASURA_ENGINE_VECTOR4_H__ -#define __ASURA_ENGINE_VECTOR4_H__ +#ifndef _ASURA_ENGINE_VECTOR4_H__ +#define _ASURA_ENGINE_VECTOR4_H__ namespace AsuraEngine { @@ -222,7 +222,7 @@ namespace AsuraEngine template <typename T> bool operator !=(const Vector4<T>& left, const Vector4<T>& right); -#include "Vector4.inl" +#include "Vector4.inc" // Define the most common types typedef Vector4<int> Vector4i; diff --git a/source/modules/asura-utils/math/vector4.inl b/source/modules/asura-utils/math/vector4.inl deleted file mode 100644 index 4b043a1..0000000 --- a/source/modules/asura-utils/math/vector4.inl +++ /dev/null @@ -1,152 +0,0 @@ - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>::Vector4() : - x(0), - y(0), - z(0), - w(0) -{ - -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>::Vector4(T X, T Y, T Z, T W) : - x(X), - y(Y), - z(Z), - w(W) -{ - -} - - -//////////////////////////////////////////////////////////// -template <typename T> -template <typename U> -inline Vector4<T>::Vector4(const Vector4<U>& vector) : - x(static_cast<T>(vector.x)), - y(static_cast<T>(vector.y)), - z(static_cast<T>(vector.z)), - w(static_cast<T>(vector.w)) -{ -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator -(const Vector4<T>& left) -{ - return Vector4<T>(-left.x, -left.y, -left.z, -left.w); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>& operator +=(Vector4<T>& left, const Vector4<T>& right) -{ - left.x += right.x; - left.y += right.y; - left.z += right.z; - left.w += right.w; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>& operator -=(Vector4<T>& left, const Vector4<T>& right) -{ - left.x -= right.x; - left.y -= right.y; - left.z -= right.z; - left.w -= right.w; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator +(const Vector4<T>& left, const Vector4<T>& right) -{ - return Vector4<T>(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator -(const Vector4<T>& left, const Vector4<T>& right) -{ - return Vector4<T>(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator *(const Vector4<T>& left, T right) -{ - return Vector4<T>(left.x * right, left.y * right, left.z * right, left.w * right); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator *(T left, const Vector4<T>& right) -{ - return Vector4<T>(right.x * left, right.y * left, right.z * left, right.w * left); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>& operator *=(Vector4<T>& left, T right) -{ - left.x *= right; - left.y *= right; - left.z *= right; - left.w *= right; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T> operator /(const Vector4<T>& left, T right) -{ - return Vector4<T>(left.x / right, left.y / right, left.z / right, left.w / right); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline Vector4<T>& operator /=(Vector4<T>& left, T right) -{ - left.x /= right; - left.y /= right; - left.z /= right; - left.w /= right; - - return left; -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline bool operator ==(const Vector4<T>& left, const Vector4<T>& right) -{ - return (left.x == right.x) && (left.y == right.y) && (left.z == right.z) && (left.w == right.w); -} - - -//////////////////////////////////////////////////////////// -template <typename T> -inline bool operator !=(const Vector4<T>& left, const Vector4<T>& right) -{ - return (left.x != right.x) || (left.y != right.y) || (left.z != right.z) || (left.w != right.w); -} |