public static TundraVector3 MoveTowards(TundraVector3 current, TundraVector3 target, float maxDistanceDelta) { var toVector = target - current; float dist = toVector.Magnitude; if (dist <= maxDistanceDelta || dist < float.Epsilon) { return(target); } return(current + (toVector / dist) * maxDistanceDelta); }
public static float Distance(TundraVector3 a, TundraVector3 b) { return((a - b).Magnitude); }