Пример #1
0
        public void Contains(ref BoundingBoxXna boxXna, out ContainmentType result)
        {
            var intersects = false;

            PlaneIntersectionType type;

            boxXna.Intersects(ref near, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            boxXna.Intersects(ref left, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            boxXna.Intersects(ref right, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            boxXna.Intersects(ref top, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            boxXna.Intersects(ref bottom, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            boxXna.Intersects(ref far, out type);
            if (type == PlaneIntersectionType.Front)
            {
                result = ContainmentType.Disjoint;
                return;
            }
            if (type == PlaneIntersectionType.Intersecting)
            {
                intersects = true;
            }

            result = intersects ? ContainmentType.Intersects : ContainmentType.Contains;
        }
Пример #2
0
 public bool Intersects(BoundingBoxXna boxXna)
 {
     return(boxXna.Intersects(this));
 }
Пример #3
0
 public PlaneIntersectionType Intersects(BoundingBoxXna boxXna)
 {
     return(boxXna.Intersects(this));
 }