/// <summary> /// Returns true if this bound is either intersecting or colliding with the other bound. /// </summary> public bool Intersects(Bound other) { // TODO: optimize this function to avoid the sqrt Real centerDistances = Vector2r.Distance(X, Z, other.X, other.Z); Real range = Radius + other.Radius; return(range >= centerDistances); }
public bool Equals(Vector2r p) { // If parameter is null return false: if ((object)p == null) { return(false); } // Return true if the fields match: return((X == p.X) && (Z == p.Z)); }
public override bool Equals(System.Object obj) { // If parameter is null return false. if (obj == null || obj is Vector2r == false) { return(false); } // If parameter cannot be cast to Point return false. Vector2r p = (Vector2r)obj; // Return true if the fields match: return(X == p.X && Z == p.Z); }
/// <summary> /// Returns true if the given point is contained within this bound. /// </summary> public bool Contains(Vector2r point) { return Contains(point.X, point.Z); }
public static Real DistanceSq(Vector2r a, Vector2r b) { return DistanceSq(a.X, a.Z, b.X, b.Z); }
public bool Equals(Vector2r p) { // If parameter is null return false: if ((object)p == null) { return false; } // Return true if the fields match: return (X == p.X) && (Z == p.Z); }
/// <summary> /// Returns true if the given point is contained within this bound. /// </summary> public bool Contains(Real x, Real z) { Real distanceSq = Vector2r.DistanceSq(X, Z, x, z); return((Radius * Radius) > distanceSq); }
/// <summary> /// Returns true if the given point is contained within this bound. /// </summary> public bool Contains(Vector2r point) { return(Contains(point.X, point.Z)); }
public static Real DistanceSq(Vector2r a, Vector2r b) { return(DistanceSq(a.X, a.Z, b.X, b.Z)); }
protected static Vector2r Interpolate(Vector2r start, Vector2r end, float percentage) { return new Vector2r( Interpolate(start.X, end.X, percentage), Interpolate(start.Z, end.Z, percentage)); }