You've already forked godot
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:
committed by
Hein-Pieter van Braam-Stewart
parent
9535a6079e
commit
340bf6e80c
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user