summaryrefslogtreecommitdiff
path: root/core/math/vector3i.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-10-03 17:39:08 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 12:03:20 +0100
commitacf0f6c8a7955517ef71ec95c683a6ff7bd5f437 (patch)
tree2bbadc4c770579be1f63317363b1843efff4d6f1 /core/math/vector3i.cpp
parent52f96abd8ba4323ff358f34683f9502ec24b9961 (diff)
GIProbes working.
Diffstat (limited to 'core/math/vector3i.cpp')
-rw-r--r--core/math/vector3i.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/math/vector3i.cpp b/core/math/vector3i.cpp
new file mode 100644
index 0000000000..d5e05c1398
--- /dev/null
+++ b/core/math/vector3i.cpp
@@ -0,0 +1,25 @@
+#include "vector3i.h"
+
+void Vector3i::set_axis(int p_axis, int32_t p_value) {
+ ERR_FAIL_INDEX(p_axis, 3);
+ coord[p_axis] = p_value;
+}
+int32_t Vector3i::get_axis(int p_axis) const {
+
+ ERR_FAIL_INDEX_V(p_axis, 3, 0);
+ return operator[](p_axis);
+}
+
+int Vector3i::min_axis() const {
+
+ return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2);
+}
+int Vector3i::max_axis() const {
+
+ return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
+}
+
+Vector3i::operator String() const {
+
+ return (itos(x) + ", " + itos(y) + ", " + itos(z));
+}