summaryrefslogtreecommitdiff
path: root/core/math/vector3.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-09 14:57:42 +0200
committerGitHub <noreply@github.com>2020-09-09 14:57:42 +0200
commita63ac0f8e04a7a953bebe247908573c530548609 (patch)
tree2c76e01fc7a249afb189edda80b2e43ffad226af /core/math/vector3.h
parent4d34677623e2551fc72e09ffdffe0323a75db5fd (diff)
parentd0a1399a1b7ef6b76f6e6094fb6dd6bd9b43d2c8 (diff)
Merge pull request #41894 from aaronfranke/ineq-exact
Change vector inequality comparison operators to use exact equality
Diffstat (limited to 'core/math/vector3.h')
-rw-r--r--core/math/vector3.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 0bc1a467f2..5370b297f1 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -322,8 +322,8 @@ bool Vector3::operator!=(const Vector3 &p_v) const {
}
bool Vector3::operator<(const Vector3 &p_v) const {
- if (Math::is_equal_approx(x, p_v.x)) {
- if (Math::is_equal_approx(y, p_v.y)) {
+ if (x == p_v.x) {
+ if (y == p_v.y) {
return z < p_v.z;
} else {
return y < p_v.y;
@@ -334,8 +334,8 @@ bool Vector3::operator<(const Vector3 &p_v) const {
}
bool Vector3::operator>(const Vector3 &p_v) const {
- if (Math::is_equal_approx(x, p_v.x)) {
- if (Math::is_equal_approx(y, p_v.y)) {
+ if (x == p_v.x) {
+ if (y == p_v.y) {
return z > p_v.z;
} else {
return y > p_v.y;
@@ -346,8 +346,8 @@ bool Vector3::operator>(const Vector3 &p_v) const {
}
bool Vector3::operator<=(const Vector3 &p_v) const {
- if (Math::is_equal_approx(x, p_v.x)) {
- if (Math::is_equal_approx(y, p_v.y)) {
+ if (x == p_v.x) {
+ if (y == p_v.y) {
return z <= p_v.z;
} else {
return y < p_v.y;
@@ -358,8 +358,8 @@ bool Vector3::operator<=(const Vector3 &p_v) const {
}
bool Vector3::operator>=(const Vector3 &p_v) const {
- if (Math::is_equal_approx(x, p_v.x)) {
- if (Math::is_equal_approx(y, p_v.y)) {
+ if (x == p_v.x) {
+ if (y == p_v.y) {
return z >= p_v.z;
} else {
return y > p_v.y;