Пример #1
0
        public ContainmentType Contains(BoundingFrustumD frustum)
        {
            if (!frustum.Intersects(this))
            {
                return(ContainmentType.Disjoint);
            }
            double num = this.Radius * this.Radius;

            foreach (Vector3D vectord in frustum.cornerArray)
            {
                Vector3D vectord2;
                vectord2.X = vectord.X - this.Center.X;
                vectord2.Y = vectord.Y - this.Center.Y;
                vectord2.Z = vectord.Z - this.Center.Z;
                if (vectord2.LengthSquared() > num)
                {
                    return(ContainmentType.Intersects);
                }
            }
            return(ContainmentType.Contains);
        }
Пример #2
0
        /// <summary>
        /// Checks whether the current BoundingSphereD contains the specified BoundingFrustum.
        /// </summary>
        /// <param name="frustum">The BoundingFrustum to check against the current BoundingSphereD.</param>
        public ContainmentType Contains(BoundingFrustumD frustum)
        {
            if (!frustum.Intersects(this))
            {
                return(ContainmentType.Disjoint);
            }
            double num = this.Radius * this.Radius;

            foreach (Vector3D Vector3D_1 in frustum.cornerArray)
            {
                Vector3D Vector3D_2;
                Vector3D_2.X = Vector3D_1.X - this.Center.X;
                Vector3D_2.Y = Vector3D_1.Y - this.Center.Y;
                Vector3D_2.Z = Vector3D_1.Z - this.Center.Z;
                if ((double)Vector3D_2.LengthSquared() > (double)num)
                {
                    return(ContainmentType.Intersects);
                }
            }
            return(ContainmentType.Contains);
        }
Пример #3
0
 /// <summary>
 /// Checks whether the current PlaneD intersects a specified BoundingFrustum.
 /// </summary>
 /// <param name="frustum">The BoundingFrustum to check for intersection with.</param>
 public PlaneIntersectionType Intersects(BoundingFrustumD frustum)
 {
     return(frustum.Intersects(this));
 }
Пример #4
0
 public bool Intersects(BoundingFrustumD frustum) =>
 frustum?.Intersects(this);
Пример #5
0
 public PlaneIntersectionType Intersects(BoundingFrustumD frustum) =>
 frustum.Intersects(this);
Пример #6
0
 public double?Intersects(BoundingFrustumD frustum) =>
 frustum?.Intersects(this);