summaryrefslogtreecommitdiffstats
path: root/src/variant/vector4i.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2022-09-19 17:57:54 -0500
committerAaron Franke <arnfranke@yahoo.com>2022-10-01 21:09:05 -0500
commitfc879c04c898e8992958133e338efe4cea9ffcc8 (patch)
tree8a57922daf29889565d230d07ae8354406b78f5d /src/variant/vector4i.cpp
parentd479208a8fe9c3c1b0f2b0acbc94635c8005d9b8 (diff)
downloadredot-cpp-fc879c04c898e8992958133e338efe4cea9ffcc8.tar.gz
Update Vector4/4i to match the engine
Diffstat (limited to 'src/variant/vector4i.cpp')
-rw-r--r--src/variant/vector4i.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/variant/vector4i.cpp b/src/variant/vector4i.cpp
index bfcd736..430d32f 100644
--- a/src/variant/vector4i.cpp
+++ b/src/variant/vector4i.cpp
@@ -49,7 +49,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);
}
@@ -86,10 +86,12 @@ Vector4i::operator Vector4() const {
}
Vector4i::Vector4i(const Vector4 &p_vec4) {
- x = p_vec4.x;
- y = p_vec4.y;
- z = p_vec4.z;
- w = p_vec4.w;
+ x = (int32_t)p_vec4.x;
+ y = (int32_t)p_vec4.y;
+ z = (int32_t)p_vec4.z;
+ w = (int32_t)p_vec4.w;
}
+static_assert(sizeof(Vector4i) == 4 * sizeof(int32_t));
+
} // namespace godot