コード例 #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;
        }
コード例 #2
0
ファイル: Plane.cs プロジェクト: Jorch72/CS-Astrid.Framework
 public void Intersects(ref BoundingSphere sphere, out PlaneIntersectionType result)
 {
     sphere.Intersects(ref this, out result);
 }
コード例 #3
0
ファイル: Plane.cs プロジェクト: Jorch72/CS-Astrid.Framework
        /*
         * public PlaneIntersectionType Intersects(BoundingFrustum frustum)
         * {
         *  return frustum.Intersects(this);
         * }
         */

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