feat: adjust route to target

This commit is contained in:
Иванов Иван
2024-08-21 22:40:23 +02:00
parent 914f6ba20f
commit d0baa5c21a
3 changed files with 28 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ using System;
namespace Client.Domain.ValueObjects
{
public class Vector3 : ObservableObject
public class Vector3 : ObservableObject, ICloneable
{
private float x;
private float y;
@@ -77,6 +77,11 @@ namespace Client.Domain.ValueObjects
return MathF.Sqrt(MathF.Pow(x - other.x, 2) + MathF.Pow(y - other.y, 2) + MathF.Pow(z - other.z, 2));
}
public object Clone()
{
return MemberwiseClone();
}
public static Vector3 operator -(Vector3 left, Vector3 right)
{
return new Vector3(left.x - right.x, left.y - right.y, left.z - right.z);