summaryrefslogtreecommitdiffstats
path: root/core/math
diff options
context:
space:
mode:
Diffstat (limited to 'core/math')
-rw-r--r--core/math/vector4.cpp6
-rw-r--r--core/math/vector4.h30
2 files changed, 15 insertions, 21 deletions
diff --git a/core/math/vector4.cpp b/core/math/vector4.cpp
index 555ca6c66c..b6b914f36d 100644
--- a/core/math/vector4.cpp
+++ b/core/math/vector4.cpp
@@ -30,6 +30,8 @@
#include "vector4.h"
+#include "core/math/math_funcs.h"
+#include "core/math/vector4i.h"
#include "core/string/ustring.h"
Vector4::Axis Vector4::min_axis_index() const {
@@ -215,3 +217,7 @@ Vector4::operator String() const {
}
static_assert(sizeof(Vector4) == 4 * sizeof(real_t));
+
+Vector4::operator Vector4i() const {
+ return Vector4i(x, y, z, w);
+}
diff --git a/core/math/vector4.h b/core/math/vector4.h
index 52699c6281..f69b4752bb 100644
--- a/core/math/vector4.h
+++ b/core/math/vector4.h
@@ -32,9 +32,11 @@
#define VECTOR4_H
#include "core/error/error_macros.h"
-#include "core/math/math_funcs.h"
+#include "core/math/math_defs.h"
+#include "core/typedefs.h"
class String;
+struct Vector4i;
struct _NO_DISCARD_ Vector4 {
static const int AXIS_COUNT = 4;
@@ -140,28 +142,14 @@ struct _NO_DISCARD_ Vector4 {
_FORCE_INLINE_ bool operator<=(const Vector4 &p_vec4) const;
operator String() const;
+ operator Vector4i() const;
_FORCE_INLINE_ Vector4() {}
-
- _FORCE_INLINE_ Vector4(real_t p_x, real_t p_y, real_t p_z, real_t p_w) :
- x(p_x),
- y(p_y),
- z(p_z),
- w(p_w) {
- }
-
- Vector4(const Vector4 &p_vec4) :
- x(p_vec4.x),
- y(p_vec4.y),
- z(p_vec4.z),
- w(p_vec4.w) {
- }
-
- void operator=(const Vector4 &p_vec4) {
- x = p_vec4.x;
- y = p_vec4.y;
- z = p_vec4.z;
- w = p_vec4.w;
+ _FORCE_INLINE_ Vector4(real_t p_x, real_t p_y, real_t p_z, real_t p_w) {
+ x = p_x;
+ y = p_y;
+ z = p_z;
+ w = p_w;
}
};