mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-03 09:24:04 +00:00
Added equality comparison to matrices and vectors.
This commit is contained in:
@@ -89,6 +89,25 @@ namespace raylib {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Matrix& other) {
|
||||
return m0 == other.m0
|
||||
&& m1 == other.m1
|
||||
&& m2 == other.m2
|
||||
&& m3 == other.m3
|
||||
&& m4 == other.m4
|
||||
&& m5 == other.m5
|
||||
&& m6 == other.m6
|
||||
&& m7 == other.m7
|
||||
&& m8 == other.m8
|
||||
&& m9 == other.m9
|
||||
&& m10 == other.m10
|
||||
&& m11 == other.m11
|
||||
&& m12 == other.m12
|
||||
&& m13 == other.m13
|
||||
&& m14 == other.m14
|
||||
&& m15 == other.m15;
|
||||
}
|
||||
|
||||
inline Matrix& SetProjection() {
|
||||
::SetMatrixProjection(*this);
|
||||
return *this;
|
||||
|
||||
@@ -45,6 +45,11 @@ namespace raylib {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Vector2& other) {
|
||||
return x == other.x
|
||||
&& y == other.y;
|
||||
}
|
||||
|
||||
#ifndef RAYLIB_CPP_NO_MATH
|
||||
Vector2 Add(const Vector2& vector2) {
|
||||
return Vector2Add(*this, vector2);
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace raylib {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Vector3& other) {
|
||||
return x == other.x
|
||||
&& y == other.y
|
||||
&& z == other.z;
|
||||
}
|
||||
|
||||
#ifndef RAYLIB_CPP_NO_MATH
|
||||
Vector3 Add(const Vector3& vector3) {
|
||||
return Vector3Add(*this, vector3);
|
||||
|
||||
@@ -57,6 +57,13 @@ namespace raylib {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Vector4& other) {
|
||||
return x == other.x
|
||||
&& y == other.y
|
||||
&& z == other.z
|
||||
&& w == other.w;
|
||||
}
|
||||
|
||||
#ifndef RAYLIB_CPP_NO_MATH
|
||||
Vector4 Multiply(const Vector4& vector4) {
|
||||
return QuaternionMultiply(*this, vector4);
|
||||
|
||||
Reference in New Issue
Block a user