Esempio n. 1
0
        /// <summary>
        /// 타원과 한 점간의 충돌 체크
        /// </summary>
        /// <param name="ellipse">타원</param>
        /// <param name="pt">좌표</param>
        /// <returns>충돌 여부</returns>
        public static bool CheckEllipse(RectangleF ellipse, PointF pt)
        {
            EllipseCollision e = new EllipseCollision(10);
            var cp             = MathTool.CenterPoint(ellipse);

            return(e.Collide(cp.X, cp.Y, ellipse.Width / 2F, ellipse.Height / 2F, pt.X, pt.Y, 0.1));
        }
Esempio n. 2
0
        /// <summary>
        /// 서로 다른 두 타원간의 충돌 체크
        /// </summary>
        /// <param name="ellipse1">타원1</param>
        /// <param name="ellipse2">타원2</param>
        /// <returns>충돌 여부</returns>
        public static bool CheckEllipse(RectangleF ellipse1, RectangleF ellipse2)
        {
            EllipseCollision e = new EllipseCollision(10);
            var cp             = MathTool.CenterPoint(ellipse1);
            var cpT            = MathTool.CenterPoint(ellipse2);

            return(e.Collide(cp.X, cp.Y, ellipse1.Width / 2F, ellipse1.Height / 2, cpT.X, cpT.Y, ellipse2.Width / 2F, ellipse2.Height / 2F));
        }