Ejemplo n.º 1
0
        public bool ContainsPoint(Vector2 point)
        {
            Vector2  invRadii = new Vector2(1.0f / Radii.x, 1.0f / Radii.y);
            Circle2D circle   = new Circle2D(Vector2.Scale(Center, invRadii), 1.0f);

            Vector2 adjustedPoint = Vector2.Scale(point, invRadii);

            return(circle.ContainsPoint(adjustedPoint));
        }
Ejemplo n.º 2
0
        public bool ContainsAnyPoint(List <Vector2> points)
        {
            Vector2  invRadii = new Vector2(1.0f / Radii.x, 1.0f / Radii.y);
            Circle2D circle   = new Circle2D(Vector2.Scale(Center, invRadii), 1.0f);

            foreach (Vector2 point in points)
            {
                Vector2 adjustedPoint = Vector2.Scale(point, invRadii);
                if (circle.ContainsPoint(adjustedPoint))
                {
                    return(true);
                }
            }

            return(false);
        }