1 using Microsoft.Xna.Framework;
12 public CachedDistance(Vector2 startWorldPos, Vector2 endWorldPos,
float dist,
double recalculationTime)
20 public bool ShouldUpdateDistance(Vector2 currentStartWorldPos, Vector2 currentEndWorldPos,
float minDistanceToUpdate = 500.0f)
23 float minDistSquared = minDistanceToUpdate * minDistanceToUpdate;
24 return Vector2.DistanceSquared(
StartWorldPos, currentStartWorldPos) > minDistSquared ||
25 Vector2.DistanceSquared(
EndWorldPos, currentEndWorldPos) > minDistSquared;
readonly Vector2 StartWorldPos
CachedDistance(Vector2 startWorldPos, Vector2 endWorldPos, float dist, double recalculationTime)
readonly Vector2 EndWorldPos
bool ShouldUpdateDistance(Vector2 currentStartWorldPos, Vector2 currentEndWorldPos, float minDistanceToUpdate=500.0f)
readonly record struct CachedLocation(Vector2 Location, double RecalculationTime)