示例#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
文件: Ray.cs 项目: zmtzawqlp/SharpDX
 /// <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
文件: Ray.cs 项目: zmtzawqlp/SharpDX
 /// <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);
 }