Skip to content

Commit 3df4563

Browse files
authored
Merge pull request #174 from Aviloi/master
Added != operator to Vector2/3/4 and Matrix
2 parents e3bf04a + 80a58ec commit 3df4563

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

include/Matrix.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class Matrix : public ::Matrix {
7171
&& m15 == other.m15;
7272
}
7373

74+
bool operator!=(const ::Matrix& other) {
75+
return !(*this == other);
76+
}
77+
7478
#ifndef RAYLIB_CPP_NO_MATH
7579
/**
7680
* Returns the trace of the matrix (sum of the values along the diagonal)

include/Vector2.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class Vector2 : public ::Vector2 {
3636
&& y == other.y;
3737
}
3838

39+
bool operator!=(const ::Vector2& other) {
40+
return !(*this == other);
41+
}
42+
3943
#ifndef RAYLIB_CPP_NO_MATH
4044
Vector2 Add(const ::Vector2& vector2) const {
4145
return Vector2Add(*this, vector2);

include/Vector3.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class Vector3 : public ::Vector3 {
4343
&& z == other.z;
4444
}
4545

46+
bool operator!=(const ::Vector3& other) {
47+
return !(*this == other);
48+
}
49+
4650
#ifndef RAYLIB_CPP_NO_MATH
4751
Vector3 Add(const ::Vector3& vector3) {
4852
return Vector3Add(*this, vector3);

include/Vector4.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class Vector4 : public ::Vector4 {
4848
&& w == other.w;
4949
}
5050

51+
bool operator!=(const ::Vector4& other) {
52+
return !(*this == other);
53+
}
54+
5155
inline ::Rectangle ToRectangle() {
5256
return {x, y, z, w};
5357
}

0 commit comments

Comments
 (0)