summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2022-08-01 04:37:07 +0200
committerRaul Santos <raulsntos@gmail.com>2022-08-01 04:50:17 +0200
commit2e5cf62dee5d79617d202d791ac40344b07d10fb (patch)
treef5ece2f528b0e82b56b6d6787ebf05b0948168a3 /core/math
parent6d599ed90b396c264486512d5903c209ce729c76 (diff)
Fix `Vector4::min_axis_index` for equal components
The documentation says if all components are equal it must return AXIS_W but it was returning AXIS_X.
Diffstat (limited to 'core/math')
-rw-r--r--core/math/vector4.cpp2
-rw-r--r--core/math/vector4i.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector4.cpp b/core/math/vector4.cpp
index ed42d8bfb9..cc0d0dcf72 100644
--- a/core/math/vector4.cpp
+++ b/core/math/vector4.cpp
@@ -89,7 +89,7 @@ Vector4::Axis Vector4::min_axis_index() const {
uint32_t min_index = 0;
real_t min_value = x;
for (uint32_t i = 1; i < 4; i++) {
- if (operator[](i) < min_value) {
+ if (operator[](i) <= min_value) {
min_index = i;
min_value = operator[](i);
}
diff --git a/core/math/vector4i.cpp b/core/math/vector4i.cpp
index 8c571b02e3..2dc5b74202 100644
--- a/core/math/vector4i.cpp
+++ b/core/math/vector4i.cpp
@@ -47,7 +47,7 @@ Vector4i::Axis Vector4i::min_axis_index() const {
uint32_t min_index = 0;
int32_t min_value = x;
for (uint32_t i = 1; i < 4; i++) {
- if (operator[](i) < min_value) {
+ if (operator[](i) <= min_value) {
min_index = i;
min_value = operator[](i);
}