summaryrefslogtreecommitdiff
path: root/modules/mono/glue/Managed/Files/Vector3.cs
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2019-03-27 13:51:05 +0300
committerChaosus <chaosus89@gmail.com>2019-04-05 17:09:57 +0300
commit55f3bd97a270b691c26d6eda70bc7c0a3ec8f4e8 (patch)
tree2026f7241b7e7670ffb97ceff22962ce90b432f7 /modules/mono/glue/Managed/Files/Vector3.cs
parent6574c557c962d9e4dd726b494322aea246a0245a (diff)
Added direction_to method to vectors
Diffstat (limited to 'modules/mono/glue/Managed/Files/Vector3.cs')
-rw-r--r--modules/mono/glue/Managed/Files/Vector3.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/mono/glue/Managed/Files/Vector3.cs b/modules/mono/glue/Managed/Files/Vector3.cs
index f6ff27989d..0c96d346a9 100644
--- a/modules/mono/glue/Managed/Files/Vector3.cs
+++ b/modules/mono/glue/Managed/Files/Vector3.cs
@@ -126,6 +126,11 @@ namespace Godot
);
}
+ public Vector3 DirectionTo(Vector3 b)
+ {
+ return new Vector3(b.x - x, b.y - y, b.z - z).Normalized();
+ }
+
public real_t DistanceSquaredTo(Vector3 b)
{
return (b - this).LengthSquared();