From 40a1d6d100d8a1823d3a939a7ad7350b36bcddbd Mon Sep 17 00:00:00 2001 From: antonWetzel Date: Mon, 8 Aug 2022 17:05:55 +0200 Subject: vector4 distance_squared_to and update csharp --- core/math/vector4.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/math/vector4.cpp') diff --git a/core/math/vector4.cpp b/core/math/vector4.cpp index 4697c311b4..1dd5adad2b 100644 --- a/core/math/vector4.cpp +++ b/core/math/vector4.cpp @@ -91,6 +91,10 @@ real_t Vector4::distance_to(const Vector4 &p_to) const { return (p_to - *this).length(); } +real_t Vector4::distance_squared_to(const Vector4 &p_to) const { + return (p_to - *this).length_squared(); +} + Vector4 Vector4::direction_to(const Vector4 &p_to) const { Vector4 ret(p_to.x - x, p_to.y - y, p_to.z - z, p_to.w - w); ret.normalize(); -- cgit v1.2.3