Esempio n. 1
0
        public void Contains(ref BoundingSphere sphere, out ContainmentType result)
        {
            bool intersects = false;

            for (int i = 0; i < PlaneCount; ++i)
            {
                PlaneIntersectionType planeIntersectionType = default(PlaneIntersectionType);

                // TODO: we might want to inline this for performance reasons
                sphere.Intersects(ref planes[i], out planeIntersectionType);
                switch (planeIntersectionType)
                {
                case PlaneIntersectionType.Front:
                    result = ContainmentType.Disjoint;
                    return;

                case PlaneIntersectionType.Intersecting:
                    intersects = true;
                    break;
                }
            }
            result = intersects ? ContainmentType.Intersects : ContainmentType.Contains;
        }
Esempio n. 2
0
 public void Intersects(ref BoundingSphere sphere, out PlaneIntersectionType result)
 {
     sphere.Intersects(ref this, out result);
 }
Esempio n. 3
0
        /*
         * public PlaneIntersectionType Intersects(BoundingFrustum frustum)
         * {
         *  return frustum.Intersects(this);
         * }
         */

        public PlaneIntersectionType Intersects(BoundingSphere sphere)
        {
            return(sphere.Intersects(this));
        }