Ejemplo n.º 1
0
        /// <summary>
        /// Checks whether the current BoundingSphere intersects with a specified BoundingFrustum.
        /// </summary>
        /// <param name="frustum">The BoundingFrustum to check for intersection with the current BoundingSphere.</param>
        public bool Intersects(BoundingFrustum frustum)
        {
            bool result;

            frustum.Intersects(ref this, out result);
            return(result);
        }
Ejemplo n.º 2
0
        public bool Intersects(BoundingFrustum frustum)
        {
            bool flag;

            frustum.Intersects(ref this, out flag);
            return(flag);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Checks whether the current BoundingBox intersects a BoundingFrustum.
 /// </summary>
 /// <param name="frustum">The BoundingFrustum to check for intersection with.</param>
 public bool Intersects(BoundingFrustum frustum)
 {
     if ((BoundingFrustum)null == frustum)
     {
         throw new ArgumentNullException("frustum");
     }
     else
     {
         return(frustum.Intersects(this));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Checks whether the Ray intersects a specified BoundingFrustum.
 /// </summary>
 /// <param name="frustum">The BoundingFrustum to check for intersection with the Ray.</param>
 public float?Intersects(BoundingFrustum frustum)
 {
     if (frustum == (BoundingFrustum)null)
     {
         throw new ArgumentNullException("frustum");
     }
     else
     {
         return(frustum.Intersects(this));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Tests whether the BoundingBox contains a BoundingFrustum.
 /// </summary>
 /// <param name="frustum">The BoundingFrustum to test for overlap.</param>
 public ContainmentType Contains(BoundingFrustum frustum)
 {
     if (!frustum.Intersects(this))
     {
         return(ContainmentType.Disjoint);
     }
     foreach (Vector3 point in frustum.cornerArray)
     {
         if (this.Contains(point) == ContainmentType.Disjoint)
         {
             return(ContainmentType.Intersects);
         }
     }
     return(ContainmentType.Contains);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Checks whether the current BoundingSphere contains the specified BoundingFrustum.
        /// </summary>
        /// <param name="frustum">The BoundingFrustum to check against the current BoundingSphere.</param>
        public ContainmentType Contains(BoundingFrustum frustum)
        {
            if (!frustum.Intersects(this))
            {
                return(ContainmentType.Disjoint);
            }
            float num = this.Radius * this.Radius;

            foreach (Vector3 vector3_1 in frustum.cornerArray)
            {
                Vector3 vector3_2;
                vector3_2.X = vector3_1.X - this.Center.X;
                vector3_2.Y = vector3_1.Y - this.Center.Y;
                vector3_2.Z = vector3_1.Z - this.Center.Z;
                if ((double)vector3_2.LengthSquared() > (double)num)
                {
                    return(ContainmentType.Intersects);
                }
            }
            return(ContainmentType.Contains);
        }
Ejemplo n.º 7
0
 public float?Intersects(BoundingFrustum frustum) =>
 frustum?.Intersects(this);
Ejemplo n.º 8
0
 /// <summary>
 /// Checks whether the current Plane intersects a specified BoundingFrustum.
 /// </summary>
 /// <param name="frustum">The BoundingFrustum to check for intersection with.</param>
 public PlaneIntersectionType Intersects(BoundingFrustum frustum)
 {
     return(frustum.Intersects(this));
 }
Ejemplo n.º 9
0
 public PlaneIntersectionType Intersects(BoundingFrustum frustum) =>
 frustum.Intersects(this);