public abstract CollisionResult DistToMask(Mask mask);
public abstract CollisionResult DistToMask(Mask mask, Vector2 dir);
//public void Draw(SpriteBatch spriteBatch, Vector2 drawPos, Color color, float depth = 0f) //{ // Vector2 save = pos; // pos = drawPos; // Draw(spriteBatch, color, depth); // pos = save; //} #region Collision public abstract bool ColMask(Mask mask);
public override CollisionResult DistToMask(Mask mask) { return(mask.DistToPolygon(this).GetAxisInvert()); }
public override CollisionResult DistToMask(Mask mask, Vector2 dir) { return(mask.DistToPolygon(this, -dir).GetAxisInvert()); }
/*public static M_Polygon GetCircle(Vector2 pos, float radius, int vertices) * { * M_Polygon poly = new M_Polygon(pos, new List<Vector2>()); * * float anglePlus = (float)(MathHelper.TwoPi / (float)vertices); * * for (float a = 0f; a < MathHelper.TwoPi; a += anglePlus) // full circle * { * poly.vertices.Add(new Vector2((float)Math.Cos(a) * radius, (float)Math.Sin(a) * radius)); * } * * return poly; * }*/ #region Collision #region mask public override bool ColMask(Mask mask) { return(mask.ColPolygon(this)); }