public Vec2D Project(Vec2D target) { Vec2D temp = Clone(); temp.ProjectThis(target); return(temp); }
public static Vec2D GetFromPool(float x = 0f, float y = 0f) { Vec2D vec = Pool.Acquire(); vec.SetTo(x, y); return(vec); }
public Vec2D Clone() { Vec2D clone = Pool.Acquire(); clone.X = X; clone.Y = Y; return(clone); }
public void ProjectThis(Vec2D target) { Vec2D temp = Pool.Acquire(); temp.X = target.X; temp.Y = target.Y; temp.Length = 1; temp.Length = Dot(temp); X = temp.X; Y = temp.Y; Pool.Release(temp); }
public float Dot(Vec2D vector) { return((X * vector.X) + (Y * vector.Y)); }
public static void RecycleToPool(Vec2D vec) { Pool.Release(vec); }