1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Added direction_to method to vectors

(cherry picked from commit 55f3bd97a2)
This commit is contained in:
Chaosus
2019-03-27 13:51:05 +03:00
committed by Hein-Pieter van Braam-Stewart
parent 9535a6079e
commit 340bf6e80c
7 changed files with 46 additions and 0 deletions

View File

@@ -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();