summaryrefslogtreecommitdiffstats
path: root/core/math/vector4.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-08-10 00:07:32 +0200
committerGitHub <noreply@github.com>2022-08-10 00:07:32 +0200
commit317ced8204d80367c445963fc989de320c6f9a68 (patch)
treede40ce8699870306e155263255e3997a979268eb /core/math/vector4.cpp
parent9da08cecbde2c7ec7522f793e934f7dfd9dc35ff (diff)
parent40a1d6d100d8a1823d3a939a7ad7350b36bcddbd (diff)
downloadredot-engine-317ced8204d80367c445963fc989de320c6f9a68.tar.gz
Merge pull request #64108 from antonWetzel/csharp-update
Diffstat (limited to 'core/math/vector4.cpp')
-rw-r--r--core/math/vector4.cpp4
1 files changed, 4 insertions, 0 deletions
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();