/// <summary> /// Checks for collisions against another bounding shape. /// </summary> /// <param name="shape">Shape to check against.</param> /// <returns>True if a collision was found.</returns> public override bool CollidesWith(BoundingShape shape) { if (shape is BoundingCircle) return BoundingShape.CollisionCircleCircle(shape as BoundingCircle, this); else if (shape is BoundingBoxAA) return BoundingShape.CollisionCircleAABox(this, shape as BoundingBoxAA); throw new Exception("Unknown bounding shape."); }
/// <summary> /// Checks for collisions against another bounding shape. /// </summary> /// <param name="shape">Shape to check against.</param> /// <returns>True if a collision was found.</returns> public override bool CollidesWith(BoundingShape shape) { if (shape is BoundingCircle) { return(BoundingShape.CollisionCircleAABox(shape as BoundingCircle, this)); } else if (shape is BoundingBoxAA) { return(BoundingShape.CollisionAABoxAABox(shape as BoundingBoxAA, this)); } throw new Exception("Unknown bounding shape."); }
/// <summary> /// Checks if the bounding shape collides with another bounding shape. /// </summary> /// <param name="shape">Shape to check against.</param> /// <returns>True if a collision was found.</returns> public abstract bool CollidesWith(BoundingShape shape);