diff options
author | vimene <vincent.menegaux@gmail.com> | 2023-12-03 09:27:32 +0100 |
---|---|---|
committer | vimene <vincent.menegaux@gmail.com> | 2023-12-03 09:27:32 +0100 |
commit | 48ec7df0fd27fab05c9918e83a3a7da1cc32d7a0 (patch) | |
tree | 259ec6e395e44b0af117adc9605203f8affb4b0f /src/math/vector.h | |
parent | 5a8bc0a4936cdd461c43740437541f8c991ff117 (diff) | |
download | engine-48ec7df0fd27fab05c9918e83a3a7da1cc32d7a0.tar.gz |
renamed MathVector{2,3,4} to Vector{2,3,4} and Mat4 to Matrix4 in engine::math
Diffstat (limited to 'src/math/vector.h')
-rw-r--r-- | src/math/vector.h | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/math/vector.h b/src/math/vector.h index 28ae81e..8f7059a 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -1,73 +1,73 @@ -#ifndef MATH_MATH_VECTOR_H -#define MATH_MATH_VECTOR_H +#ifndef MATH_VECTOR_H +#define MATH_VECTOR_H namespace engine::math { -class MathVector2 { +class Vector2 { public: float x, y; - MathVector2(); - MathVector2(float x, float y); - bool operator==(MathVector2 other) const; - bool operator!=(MathVector2 other) const; - MathVector2 operator+() const; - MathVector2 operator-() const; - MathVector2 operator+(MathVector2 other) const; - MathVector2 operator-(MathVector2 other) const; - float det(MathVector2 other) const; - MathVector2 round() const; + Vector2(); + Vector2(float x, float y); + bool operator==(Vector2 other) const; + bool operator!=(Vector2 other) const; + Vector2 operator+() const; + Vector2 operator-() const; + Vector2 operator+(Vector2 other) const; + Vector2 operator-(Vector2 other) const; + float det(Vector2 other) const; + Vector2 round() const; }; -MathVector2 operator*(float n, MathVector2 other); -MathVector2 operator*(MathVector2 other, float n); -MathVector2 operator/(MathVector2 other, float n); +Vector2 operator*(float n, Vector2 other); +Vector2 operator*(Vector2 other, float n); +Vector2 operator/(Vector2 other, float n); -class MathVector3 { +class Vector3 { public: float x, y, z; - MathVector3(); - MathVector3(float x, float y, float z); - bool operator==(MathVector3 other) const; - bool operator!=(MathVector3 other) const; - MathVector3 operator+() const; - MathVector3 operator-() const; - MathVector3 operator+(MathVector3 other) const; - MathVector3 operator-(MathVector3 other) const; - MathVector3 round() const; - MathVector2 xy() const; - MathVector3 cross(MathVector3 other) const; + Vector3(); + Vector3(float x, float y, float z); + bool operator==(Vector3 other) const; + bool operator!=(Vector3 other) const; + Vector3 operator+() const; + Vector3 operator-() const; + Vector3 operator+(Vector3 other) const; + Vector3 operator-(Vector3 other) const; + Vector3 round() const; + Vector2 xy() const; + Vector3 cross(Vector3 other) const; }; -MathVector3 operator*(float n, MathVector3 other); -MathVector3 operator*(MathVector3 other, float n); -MathVector3 operator/(MathVector3 other, float n); +Vector3 operator*(float n, Vector3 other); +Vector3 operator*(Vector3 other, float n); +Vector3 operator/(Vector3 other, float n); -class MathVector4 { +class Vector4 { public: float x, y, z, w; - MathVector4(); - MathVector4(float x, float y, float z, float w); - MathVector4(float x, float y, float z); - MathVector4(MathVector3 v, float w); - MathVector4(MathVector3 v); - bool operator==(MathVector4 other) const; - bool operator!=(MathVector4 other) const; - MathVector4 operator+() const; - MathVector4 operator-() const; - MathVector4 operator+(MathVector4 other) const; - MathVector4 operator-(MathVector4 other) const; - MathVector4 round() const; - MathVector3 xyz() const; - MathVector3 div_by_w() const; + Vector4(); + Vector4(float x, float y, float z, float w); + Vector4(float x, float y, float z); + Vector4(Vector3 v, float w); + Vector4(Vector3 v); + bool operator==(Vector4 other) const; + bool operator!=(Vector4 other) const; + Vector4 operator+() const; + Vector4 operator-() const; + Vector4 operator+(Vector4 other) const; + Vector4 operator-(Vector4 other) const; + Vector4 round() const; + Vector3 xyz() const; + Vector3 div_by_w() const; }; -MathVector4 operator*(float n, MathVector4 other); -MathVector4 operator*(MathVector4 other, float n); -MathVector4 operator/(MathVector4 other, float n); +Vector4 operator*(float n, Vector4 other); +Vector4 operator*(Vector4 other, float n); +Vector4 operator/(Vector4 other, float n); } -#endif // MATH_MATH_VECTOR_H +#endif // MATH_VECTOR_H |