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); }
public ContainmentType Contains(SharpDX.BoundingSphere bs) { return(sbb.Contains(ref bs)); }
public BoundingSphere(SharpDX.BoundingSphere sphere) { this.sSphere = sphere; }
/// <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; }
/// <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); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
public BoundingSphere(Vector3 center, float radius) { this.sSphere = new SharpDX.BoundingSphere(center, radius); }