Пример #1
0
        public bool Contains(BoundingSphere sphere)
        {
            var vec         = sphere.Center.ToSharpDX() / FRUSTUM_DIVISOR;
            var sharpSphere = new SharpDX.BoundingSphere(vec, sphere.Radius / FRUSTUM_DIVISOR);
            var contains    = _frustum.Contains(ref sharpSphere);

            return(contains == ContainmentType.Contains || contains == ContainmentType.Intersects);
        }
Пример #2
0
 public ContainmentType Contains(SharpDX.BoundingSphere bs)
 {
     return(sbb.Contains(ref bs));
 }
Пример #3
0
 public BoundingSphere(SharpDX.BoundingSphere sphere)
 {
     this.sSphere = sphere;
 }
Пример #4
0
 /// <summary>
 /// Checks whether the current BoundingFrustum intersects a BoundingSphere.
 /// </summary>
 /// <param name="sphere">The sphere.</param>
 /// <param name="result">Set to <c>true</c> if the current BoundingFrustum intersects a BoundingSphere.</param>
 public void Intersects(ref BoundingSphere sphere, out bool result)
 {
     result = Contains(ref sphere) != ContainmentType.Disjoint;
 }
Пример #5
0
 /// <summary>
 /// Checks whether the current BoundingFrustum intersects a BoundingSphere.
 /// </summary>
 /// <param name="sphere">The sphere.</param>
 /// <returns>Type of the containment</returns>
 public bool Intersects(ref BoundingSphere sphere)
 {
     return(Contains(ref sphere) != ContainmentType.Disjoint);
 }
Пример #6
0
 /// <summary>
 /// Determines the intersection relationship between the frustum and a bounding sphere.
 /// </summary>
 /// <param name="sphere">The sphere.</param>
 /// <param name="result">Type of the containment.</param>
 public void Contains(ref BoundingSphere sphere, out ContainmentType result)
 {
     result = Contains(ref sphere);
 }
Пример #7
0
 /// <summary>
 /// Determines the intersection relationship between the frustum and a bounding sphere.
 /// </summary>
 /// <param name="sphere">The sphere.</param>
 /// <returns>Type of the containment</returns>
 public ContainmentType Contains(BoundingSphere sphere)
 {
     return(Contains(ref sphere));
 }
Пример #8
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public PlaneIntersectionType Intersects(ref BoundingSphere sphere)
 {
     return(Collision.PlaneIntersectsSphere(ref this, ref sphere));
 }
Пример #9
0
 /// <summary>
 /// Constructs a <see cref="BoundingBox"/> from a given sphere.
 /// </summary>
 /// <param name="sphere">The sphere that will designate the extents of the box.</param>
 /// <param name="result">When the method completes, contains the newly constructed bounding box.</param>
 public static void FromSphere(ref BoundingSphere sphere, out BoundingBox result)
 {
     result.Minimum = new Vector3(sphere.Center.X - sphere.Radius, sphere.Center.Y - sphere.Radius, sphere.Center.Z - sphere.Radius);
     result.Maximum = new Vector3(sphere.Center.X + sphere.Radius, sphere.Center.Y + sphere.Radius, sphere.Center.Z + sphere.Radius);
 }
Пример #10
0
 /// <summary>
 /// Determines whether the current objects contains a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <returns>The type of containment the two objects have.</returns>
 public ContainmentType Contains(ref BoundingSphere sphere)
 {
     return(Collision.BoxContainsSphere(ref this, ref sphere));
 }
Пример #11
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(BoundingSphere sphere)
 {
     return(Intersects(ref sphere));
 }
Пример #12
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref BoundingSphere sphere)
 {
     return(Collision.BoxIntersectsSphere(ref this, ref sphere));
 }
Пример #13
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <param name="point">When the method completes, contains the point of intersection,
 /// or <see cref="Vector3.Zero"/> if there was no intersection.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref BoundingSphere sphere, out Vector3 point)
 {
     return(Collision.RayIntersectsSphere(ref this, ref sphere, out point));
 }
Пример #14
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingSphere"/>.
 /// </summary>
 /// <param name="sphere">The sphere to test.</param>
 /// <param name="distance">When the method completes, contains the distance of the intersection,
 /// or 0 if there was no intersection.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public bool Intersects(ref BoundingSphere sphere, out float distance)
 {
     return(Collision.RayIntersectsSphere(ref this, ref sphere, out distance));
 }
Пример #15
-1
 public BoundingSphere(SharpDX.BoundingSphere sphere)
 {
     this.sSphere = sphere;
 }
Пример #16
-1
 public BoundingSphere(Vector3 center, float radius)
 {
     this.sSphere = new SharpDX.BoundingSphere(center, radius);
 }