summaryrefslogtreecommitdiff
path: root/core/math/vector3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/vector3.cpp')
-rw-r--r--core/math/vector3.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp
index 353b2acd16..8acbe31f35 100644
--- a/core/math/vector3.cpp
+++ b/core/math/vector3.cpp
@@ -33,12 +33,10 @@
#include "core/math/basis.h"
void Vector3::rotate(const Vector3 &p_axis, real_t p_phi) {
-
*this = Basis(p_axis, p_phi).xform(*this);
}
Vector3 Vector3::rotated(const Vector3 &p_axis, real_t p_phi) const {
-
Vector3 r = *this;
r.rotate(p_axis, p_phi);
return r;
@@ -49,35 +47,29 @@ void Vector3::set_axis(int p_axis, real_t p_value) {
coord[p_axis] = p_value;
}
real_t Vector3::get_axis(int p_axis) const {
-
ERR_FAIL_INDEX_V(p_axis, 3, 0);
return operator[](p_axis);
}
int Vector3::min_axis() const {
-
return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2);
}
int Vector3::max_axis() const {
-
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
}
void Vector3::snap(Vector3 p_val) {
-
x = Math::stepify(x, p_val.x);
y = Math::stepify(y, p_val.y);
z = Math::stepify(z, p_val.z);
}
Vector3 Vector3::snapped(Vector3 p_val) const {
-
Vector3 v = *this;
v.snap(p_val);
return v;
}
Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_t) const {
-
Vector3 p0 = p_pre_a;
Vector3 p1 = *this;
Vector3 p2 = p_b;
@@ -109,7 +101,6 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a,
}
Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_t) const {
-
Vector3 p0 = p_pre_a;
Vector3 p1 = *this;
Vector3 p2 = p_b;
@@ -135,7 +126,6 @@ Vector3 Vector3::move_toward(const Vector3 &p_to, const real_t p_delta) const {
}
Basis Vector3::outer(const Vector3 &p_b) const {
-
Vector3 row0(x * p_b.x, x * p_b.y, x * p_b.z);
Vector3 row1(y * p_b.x, y * p_b.y, y * p_b.z);
Vector3 row2(z * p_b.x, z * p_b.y, z * p_b.z);
@@ -150,11 +140,9 @@ Basis Vector3::to_diagonal_matrix() const {
}
bool Vector3::is_equal_approx(const Vector3 &p_v) const {
-
return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y) && Math::is_equal_approx(z, p_v.z);
}
Vector3::operator String() const {
-
return (rtos(x) + ", " + rtos(y) + ", " + rtos(z));
}