Esempio n. 1
0
 public abstract CollisionResult DistToMask(Mask mask);
Esempio n. 2
0
 public abstract CollisionResult DistToMask(Mask mask, Vector2 dir);
Esempio n. 3
0
        //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);
Esempio n. 4
0
 public override CollisionResult DistToMask(Mask mask)
 {
     return(mask.DistToPolygon(this).GetAxisInvert());
 }
Esempio n. 5
0
 public override CollisionResult DistToMask(Mask mask, Vector2 dir)
 {
     return(mask.DistToPolygon(this, -dir).GetAxisInvert());
 }
Esempio n. 6
0
        /*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));
        }