예제 #1
0
        /// <summary>
        /// 만약 Gfx의 rotate값이 0이 아닐 경우, RContains 함수가 정확합니다. 다만, 보시다시피, 비싼 계산을 요구합니다.
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public bool RContains(Point p)
        {
            Vector2 v  = Method2D.PtV(p);
            Point   RO = new Point(Pos.X + (ROrigin.X * Bound.Width) / Texture.Width, Pos.Y + (ROrigin.Y * Bound.Height) / Texture.Height); //실제 회전중심의 위치를 잡습니다.

            v = Vector2.Transform(v, Matrix2D.Rotate(RO, -Rotate));
            return(Bound.Contains(Method2D.VtP(v)));
        }
예제 #2
0
 public static void Draw(Gfx2D gfx, Color c) => spriteBatch.Draw(gfx.Texture, new Rectangle(gfx.Pos.X + (gfx.ROrigin.X * gfx.Bound.Width) / gfx.Texture.Width, gfx.Pos.Y + (gfx.ROrigin.Y * gfx.Bound.Height) / gfx.Texture.Height, gfx.Bound.Width, gfx.Bound.Height), null, c, gfx.Rotate, Method2D.PtV(gfx.ROrigin), SpriteEffects.None, 0);