public final class BoundingSphere extends ValueType implements IEquatable<BoundingSphere>
Modifier and Type | Field and Description |
---|---|
Vector3 |
Center
The center point of the sphere.
|
float |
Radius
The radius of the sphere.
|
Constructor and Description |
---|
BoundingSphere()
Creates a new instance of BoundingSphere.
|
BoundingSphere(Vector3 center,
float radius)
Creates a new instance of BoundingSphere.
|
Modifier and Type | Method and Description |
---|---|
ContainmentType |
Contains(BoundingBox box)
Checks whether the current BoundingSphere contains the specified BoundingBox.
|
void |
Contains(BoundingBox box,
ContainmentType result)
Checks whether the current BoundingSphere contains the specified BoundingBox.
|
ContainmentType |
Contains(BoundingSphere sphere)
Checks whether the current BoundingSphere contains the specified BoundingSphere.
|
void |
Contains(BoundingSphere sphere,
ContainmentType result)
Checks whether the current BoundingSphere contains the specified BoundingSphere.
|
ContainmentType |
Contains(Vector3 point)
Checks whether the current BoundingSphere contains the specified point.
|
void |
Contains(Vector3 point,
ContainmentType result)
Checks whether the current BoundingSphere contains the specified point.
|
static BoundingSphere |
CreateFromBoundingBox(BoundingBox box)
Creates the smallest BoundingSphere that can contain a specified BoundingBox.
|
static void |
CreateFromBoundingBox(BoundingBox box,
BoundingSphere result)
Creates the smallest BoundingSphere that can contain a specified BoundingBox.
|
static BoundingSphere |
CreateMerged(BoundingSphere original,
BoundingSphere additional)
Creates a BoundingSphere that contains the two specified BoundingSphere instances.
|
static void |
CreateMerged(BoundingSphere original,
BoundingSphere additional,
BoundingSphere result)
Creates a BoundingSphere that contains the two specified BoundingSphere instances.
|
boolean |
Equals(BoundingSphere other)
Determines whether the specified BoundingSphere is equal to the current BoundingSphere.
|
boolean |
equals(java.lang.Object obj)
Determines whether the specified Object is equal to the BoundingSphere.
|
int |
hashCode()
Gets the hash code for this instance.
|
boolean |
Intersects(BoundingBox box)
Checks whether the current BoundingSphere intersects with a specified BoundingBox.
|
void |
Intersects(BoundingBox box,
boolean result)
Checks whether the current BoundingSphere intersects a BoundingBox.
|
boolean |
Intersects(BoundingSphere sphere)
Checks whether the current BoundingSphere intersects with a specified BoundingSphere.
|
void |
Intersects(BoundingSphere sphere,
boolean result)
Checks whether the current BoundingSphere intersects another BoundingSphere.
|
PlaneIntersectionType |
Intersects(Plane plane)
Checks whether the current BoundingSphere intersects with a specified Plane.
|
void |
Intersects(Plane plane,
PlaneIntersectionType result)
Checks whether the current BoundingSphere intersects a Plane.
|
java.lang.Float |
Intersects(Ray ray)
Checks whether the current BoundingSphere intersects with a specified Ray.
|
void |
Intersects(Ray ray,
java.lang.Float result)
Checks whether the current BoundingSphere intersects a Ray.
|
java.lang.String |
toString()
Returns a String that represents the current BoundingSphere.
|
BoundingSphere |
Transform(Matrix matrix)
Translates and scales the BoundingSphere using a given Matrix.
|
void |
Transform(Matrix matrix,
BoundingSphere result)
Translates and scales the BoundingSphere using a given Matrix.
|
public Vector3 Center
public float Radius
public BoundingSphere(Vector3 center, float radius)
center
- Center point of the sphere.radius
- Radius of the sphere.public BoundingSphere()
public ContainmentType Contains(BoundingBox box)
box
- The BoundingBox to check against the current BoundingSphere.public ContainmentType Contains(BoundingSphere sphere)
sphere
- The BoundingSphere to check against the current BoundingSphere.public ContainmentType Contains(Vector3 point)
point
- The point to check against the current BoundingSphere.public void Contains(BoundingBox box, ContainmentType result)
box
- The BoundingBox to test for overlap.result
- [OutAttribute] Enumeration indicating the extent of overlap.public void Contains(BoundingSphere sphere, ContainmentType result)
sphere
- The BoundingSphere to test for overlap.result
- [OutAttribute] Enumeration indicating the extent of overlap.public void Contains(Vector3 point, ContainmentType result)
point
- The point to test for overlap.result
- [OutAttribute] Enumeration indicating the extent of overlap.public static BoundingSphere CreateFromBoundingBox(BoundingBox box)
box
- The BoundingBox to create the BoundingSphere from.public static void CreateFromBoundingBox(BoundingBox box, BoundingSphere result)
box
- The BoundingBox to create the BoundingSphere from.result
- [OutAttribute] The created BoundingSphere.public static BoundingSphere CreateMerged(BoundingSphere original, BoundingSphere additional)
original
- BoundingSphere to be merged.additional
- BoundingSphere to be merged.public static void CreateMerged(BoundingSphere original, BoundingSphere additional, BoundingSphere result)
original
- BoundingSphere to be merged.additional
- BoundingSphere to be merged.result
- [OutAttribute] The created BoundingSphere.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The Object to compare with the current BoundingSphere.public boolean Equals(BoundingSphere other)
Equals
in interface IEquatable<BoundingSphere>
other
- The BoundingSphere to compare with the current BoundingSphere.public int hashCode()
hashCode
in class java.lang.Object
public boolean Intersects(BoundingBox box)
box
- The BoundingBox to check for intersection with the current BoundingSphere.public boolean Intersects(BoundingSphere sphere)
sphere
- The BoundingSphere to check for intersection with the current BoundingSphere.public PlaneIntersectionType Intersects(Plane plane)
plane
- The Plane to check for intersection with the current BoundingSphere.public java.lang.Float Intersects(Ray ray)
ray
- The Ray to check for intersection with the current BoundingSphere.public void Intersects(BoundingBox box, boolean result)
box
- The BoundingBox to check for intersection with.result
- [OutAttribute] true if the BoundingSphere and BoundingBox intersect; false otherwise.public void Intersects(BoundingSphere sphere, boolean result)
sphere
- The BoundingSphere to check for intersection with.result
- [OutAttribute] true if the BoundingSphere instances intersect; false otherwise.public void Intersects(Plane plane, PlaneIntersectionType result)
plane
- The Plane to check for intersection with.result
- [OutAttribute] An enumeration indicating whether the BoundingSphere intersects the Plane.public void Intersects(Ray ray, java.lang.Float result)
ray
- The Ray to check for intersection with.result
- [OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.public java.lang.String toString()
toString
in class java.lang.Object
public BoundingSphere Transform(Matrix matrix)
matrix
- A transformation matrix that might include translation, rotation, or uniform scaling. Note that BoundingSphere.Transform will not return correct results if there
are non-uniform scaling, shears, or other unusual transforms in this transformation matrix. This is because there is no way to shear or non-uniformly scale a
sphere. Such an operation would cause the sphere to lose its shape as a sphere.public void Transform(Matrix matrix, BoundingSphere result)
matrix
- A transformation matrix that might include translation, rotation, or uniform scaling. Note that BoundingSphere.Transform will not return correct results if there
are non-uniform scaling, shears, or other unusual transforms in this transformation matrix. This is because there is no way to shear or non-uniformly scale a
sphere. Such an operation would cause the sphere to lose its shape as a sphere.result
- [OutAttribute] The transformed BoundingSphere.