protected Thing(Galaxia galaxia, Vector2 size, Vector2 position, float rotation) { this.centro = position; this.tamanio = size; this.rotacion = rotation; this.galaxia = galaxia; boundingCircle = new BoundingCircle(centro, (float)Math.Sqrt(((tamanio.X / 2.0f) * (tamanio.X / 2.0f) + (tamanio.Y / 2.0f) * (tamanio.Y / 2.0f)))); galaxia.AgregarThing(this); }
public override BoundingObject[] CrearBoundingObjects() { if (boundingObjects == null) { boundingObjects = new BoundingObject[1]; boundingObjects[0] = new BoundingCircle(new Vector2(0, 0), Tamanio.X / 2.0f); } return(boundingObjects); }
public override bool IntersectsWith(BoundingCircle bc) { Vector2 vDiff = bc.center - this.center; float sumRadius = bc.radius + this.radius; if (vDiff.LengthSqr <= sumRadius * sumRadius) { return(true); } return(false); }
public override bool IntersectsWith(BoundingCircle bc) { return(bc.IntersectsWith(this)); }
public abstract bool IntersectsWith(BoundingCircle circle);