Exemplo n.º 1
0
        public float Intersects(BoundingPolygon polygon)
        {
            float result;

            polygon.Intersects(ref this, out result);
            return(result);
        }
Exemplo n.º 2
0
        public bool Intersects(BoundingPolygon polygon)
        {
            bool result;

            Intersects(ref polygon, out result);
            return(result);
        }
        public bool Intersects(BoundingPolygon polygon)
        {
            bool result;

            polygon.Intersects(ref this, out result);
            return(result);
        }
        public Containment Contains(BoundingPolygon polygon)
        {
            Containment result;

            Contains(ref polygon, out result);
            return(result);
        }
Exemplo n.º 5
0
        public static void FromVectors(Vector2[] vertices, out BoundingCircle result)
        {
            BoundingPolygon.GetCentroid(vertices, out result.Center);
            result.Radius = -1;
            for (var index = 0; index < vertices.Length; ++index)
            {
                float distSq;
                Vector2Helper.DistanceSq(ref result.Center, ref vertices[index], out distSq);
                if (result.Radius == -1 || (distSq < result.Radius))
                {
                    result.Radius = distSq;
                }
            }

            result.Radius = MathF.Sqrt(result.Radius);
        }
        // Duplicates with BoundingCircle.
        public void Contains(ref BoundingPolygon polygon, out Containment result)
        {
            var vertices = polygon.Vertices;

            result = Containment.Unknown;
            for (var index = 0; index < vertices.Length && result != Containment.Intersects; ++index)
            {
                Containment con;
                Contains(ref vertices[index], out con);
                result |= con;
            }

            if (result == Containment.Disjoint)
            {
                bool test;
                polygon.Intersects(ref this, out test);
                if (test)
                {
                    result = Containment.Intersects;
                }
            }
        }
Exemplo n.º 7
0
 public void Intersects(ref BoundingPolygon polygon, out float result)
 {
     polygon.Intersects(ref this, out result);
 }
Exemplo n.º 8
0
        public void Intersects(ref BoundingPolygon polygon, out bool result)
        {
            var vertices = polygon.Vertices;

            CheckVerticesForIntersection(vertices, out result);
        }