|
@@ -84,6 +84,9 @@ struct _NO_DISCARD_ Vector4i {
|
|
_FORCE_INLINE_ int64_t length_squared() const;
|
|
_FORCE_INLINE_ int64_t length_squared() const;
|
|
_FORCE_INLINE_ double length() const;
|
|
_FORCE_INLINE_ double length() const;
|
|
|
|
|
|
|
|
+ _FORCE_INLINE_ int64_t distance_squared_to(const Vector4i &p_to) const;
|
|
|
|
+ _FORCE_INLINE_ double distance_to(const Vector4i &p_to) const;
|
|
|
|
+
|
|
_FORCE_INLINE_ void zero();
|
|
_FORCE_INLINE_ void zero();
|
|
|
|
|
|
_FORCE_INLINE_ Vector4i abs() const;
|
|
_FORCE_INLINE_ Vector4i abs() const;
|
|
@@ -140,6 +143,14 @@ double Vector4i::length() const {
|
|
return Math::sqrt((double)length_squared());
|
|
return Math::sqrt((double)length_squared());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int64_t Vector4i::distance_squared_to(const Vector4i &p_to) const {
|
|
|
|
+ return (p_to - *this).length_squared();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+double Vector4i::distance_to(const Vector4i &p_to) const {
|
|
|
|
+ return (p_to - *this).length();
|
|
|
|
+}
|
|
|
|
+
|
|
Vector4i Vector4i::abs() const {
|
|
Vector4i Vector4i::abs() const {
|
|
return Vector4i(Math::abs(x), Math::abs(y), Math::abs(z), Math::abs(w));
|
|
return Vector4i(Math::abs(x), Math::abs(y), Math::abs(z), Math::abs(w));
|
|
}
|
|
}
|