summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/variant/vector4i.hpp
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 /include/godot_cpp/variant/vector4i.hpp
parentd479208a8fe9c3c1b0f2b0acbc94635c8005d9b8 (diff)
downloadredot-cpp-fc879c04c898e8992958133e338efe4cea9ffcc8.tar.gz
Update Vector4/4i to match the engine
Diffstat (limited to 'include/godot_cpp/variant/vector4i.hpp')
-rw-r--r--include/godot_cpp/variant/vector4i.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/godot_cpp/variant/vector4i.hpp b/include/godot_cpp/variant/vector4i.hpp
index ce485c2..979fc83 100644
--- a/include/godot_cpp/variant/vector4i.hpp
+++ b/include/godot_cpp/variant/vector4i.hpp
@@ -45,6 +45,8 @@ class Vector4i {
friend class Variant;
public:
+ static const int AXIS_COUNT = 4;
+
enum Axis {
AXIS_X,
AXIS_Y,
@@ -64,10 +66,12 @@ public:
};
_FORCE_INLINE_ const int32_t &operator[](const int p_axis) const {
+ DEV_ASSERT((unsigned int)p_axis < 4);
return coord[p_axis];
}
_FORCE_INLINE_ int32_t &operator[](const int p_axis) {
+ DEV_ASSERT((unsigned int)p_axis < 4);
return coord[p_axis];
}
@@ -137,11 +141,11 @@ double Vector4i::length() const {
}
Vector4i Vector4i::abs() const {
- return Vector4i(ABS(x), ABS(y), ABS(z), ABS(w));
+ return Vector4i(Math::abs(x), Math::abs(y), Math::abs(z), Math::abs(w));
}
Vector4i Vector4i::sign() const {
- return Vector4i(SIGN(x), SIGN(y), SIGN(z), SIGN(w));
+ return Vector4i(Math::sign(x), Math::sign(y), Math::sign(z), Math::sign(w));
}
/* Operators */