AcTools.Render.Base.Cameras.Frustum.Intersect C# (CSharp) Метод

Intersect() публичный Метод

public Intersect ( BoundingBox box ) : FrustrumIntersectionType
box BoundingBox
Результат FrustrumIntersectionType
        public FrustrumIntersectionType Intersect(BoundingBox box) {
            var totalIn = 0;

            foreach (var intersection in Planes.Select(plane => Plane.Intersects(plane, box))) {
                switch (intersection) {
                    case PlaneIntersectionType.Back:
                        return FrustrumIntersectionType.None;
                    case PlaneIntersectionType.Front:
                        totalIn++;
                        break;
                }
            }

            return totalIn == 6 ? FrustrumIntersectionType.Inside : FrustrumIntersectionType.Intersection;
        }
    }

Usage Example

Пример #1
0
 public virtual bool Visible(BoundingBox box)
 {
     if (DisableFrustum)
     {
         return(true);
     }
     if (Frustum == null)
     {
         throw new Exception("Call SetLens() first");
     }
     return(Frustum.Intersect(box) > 0);
 }
All Usage Examples Of AcTools.Render.Base.Cameras.Frustum::Intersect