diff options
Diffstat (limited to 'core/math/vector3i.h')
-rw-r--r-- | core/math/vector3i.h | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/core/math/vector3i.h b/core/math/vector3i.h index 60e5b94c12..5ecd3228b2 100644 --- a/core/math/vector3i.h +++ b/core/math/vector3i.h @@ -35,7 +35,6 @@ #include "core/ustring.h" struct Vector3i { - enum Axis { AXIS_X, AXIS_Y, @@ -53,12 +52,10 @@ struct Vector3i { }; _FORCE_INLINE_ const int32_t &operator[](int p_axis) const { - return coord[p_axis]; } _FORCE_INLINE_ int32_t &operator[](int p_axis) { - return coord[p_axis]; } @@ -109,19 +106,16 @@ struct Vector3i { }; Vector3i Vector3i::abs() const { - return Vector3i(ABS(x), ABS(y), ABS(z)); } Vector3i Vector3i::sign() const { - return Vector3i(SGN(x), SGN(y), SGN(z)); } /* Operators */ Vector3i &Vector3i::operator+=(const Vector3i &p_v) { - x += p_v.x; y += p_v.y; z += p_v.z; @@ -129,36 +123,30 @@ Vector3i &Vector3i::operator+=(const Vector3i &p_v) { } Vector3i Vector3i::operator+(const Vector3i &p_v) const { - return Vector3i(x + p_v.x, y + p_v.y, z + p_v.z); } Vector3i &Vector3i::operator-=(const Vector3i &p_v) { - x -= p_v.x; y -= p_v.y; z -= p_v.z; return *this; } Vector3i Vector3i::operator-(const Vector3i &p_v) const { - return Vector3i(x - p_v.x, y - p_v.y, z - p_v.z); } Vector3i &Vector3i::operator*=(const Vector3i &p_v) { - x *= p_v.x; y *= p_v.y; z *= p_v.z; return *this; } Vector3i Vector3i::operator*(const Vector3i &p_v) const { - return Vector3i(x * p_v.x, y * p_v.y, z * p_v.z); } Vector3i &Vector3i::operator/=(const Vector3i &p_v) { - x /= p_v.x; y /= p_v.y; z /= p_v.z; @@ -166,12 +154,10 @@ Vector3i &Vector3i::operator/=(const Vector3i &p_v) { } Vector3i Vector3i::operator/(const Vector3i &p_v) const { - return Vector3i(x / p_v.x, y / p_v.y, z / p_v.z); } Vector3i &Vector3i::operator*=(int32_t p_scalar) { - x *= p_scalar; y *= p_scalar; z *= p_scalar; @@ -179,17 +165,14 @@ Vector3i &Vector3i::operator*=(int32_t p_scalar) { } _FORCE_INLINE_ Vector3i operator*(int32_t p_scalar, const Vector3i &p_vec) { - return p_vec * p_scalar; } Vector3i Vector3i::operator*(int32_t p_scalar) const { - return Vector3i(x * p_scalar, y * p_scalar, z * p_scalar); } Vector3i &Vector3i::operator/=(int32_t p_scalar) { - x /= p_scalar; y /= p_scalar; z /= p_scalar; @@ -197,27 +180,22 @@ Vector3i &Vector3i::operator/=(int32_t p_scalar) { } Vector3i Vector3i::operator/(int32_t p_scalar) const { - return Vector3i(x / p_scalar, y / p_scalar, z / p_scalar); } Vector3i Vector3i::operator-() const { - return Vector3i(-x, -y, -z); } bool Vector3i::operator==(const Vector3i &p_v) const { - return (x == p_v.x && y == p_v.y && z == p_v.z); } bool Vector3i::operator!=(const Vector3i &p_v) const { - return (x != p_v.x || y != p_v.y || z != p_v.z); } bool Vector3i::operator<(const Vector3i &p_v) const { - if (x == p_v.x) { if (y == p_v.y) return z < p_v.z; @@ -229,7 +207,6 @@ bool Vector3i::operator<(const Vector3i &p_v) const { } bool Vector3i::operator>(const Vector3i &p_v) const { - if (x == p_v.x) { if (y == p_v.y) return z > p_v.z; @@ -241,7 +218,6 @@ bool Vector3i::operator>(const Vector3i &p_v) const { } bool Vector3i::operator<=(const Vector3i &p_v) const { - if (x == p_v.x) { if (y == p_v.y) return z <= p_v.z; @@ -253,7 +229,6 @@ bool Vector3i::operator<=(const Vector3i &p_v) const { } bool Vector3i::operator>=(const Vector3i &p_v) const { - if (x == p_v.x) { if (y == p_v.y) return z >= p_v.z; @@ -265,7 +240,6 @@ bool Vector3i::operator>=(const Vector3i &p_v) const { } void Vector3i::zero() { - x = y = z = 0; } |