Nebula
Loading...
Searching...
No Matches
Mathf.BoundingSphere Struct Reference

Detailed Description

Describes a sphere in 3D-space for bounding operations.

Inherits IEquatable< BoundingSphere >.

Public Member Functions

 BoundingSphere (Vector3 center, float radius)
 Constructs a bounding sphere with the specified center and radius.
 
ContainmentType Contains (BoundingBox box)
 Test if a bounding box is fully inside, outside, or just intersecting the sphere.
 
void Contains (ref BoundingBox box, out ContainmentType result)
 Test if a bounding box is fully inside, outside, or just intersecting the sphere.
 
ContainmentType Contains (BoundingFrustum frustum)
 Test if a frustum is fully inside, outside, or just intersecting the sphere.
 
void Contains (ref BoundingFrustum frustum, out ContainmentType result)
 Test if a frustum is fully inside, outside, or just intersecting the sphere.
 
ContainmentType Contains (BoundingSphere sphere)
 Test if a sphere is fully inside, outside, or just intersecting the sphere.
 
void Contains (ref BoundingSphere sphere, out ContainmentType result)
 Test if a sphere is fully inside, outside, or just intersecting the sphere.
 
ContainmentType Contains (Vector3 point)
 Test if a point is fully inside, outside, or just intersecting the sphere.
 
void Contains (ref Vector3 point, out ContainmentType result)
 Test if a point is fully inside, outside, or just intersecting the sphere.
 
bool Equals (BoundingSphere other)
 Compares whether current instance is equal to specified BoundingSphere.
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified Object.
 
override int GetHashCode ()
 Gets the hash code of this BoundingSphere.
 
bool Intersects (BoundingBox box)
 Gets whether or not a specified BoundingBox intersects with this sphere.
 
void Intersects (ref BoundingBox box, out bool result)
 Gets whether or not a specified BoundingBox intersects with this sphere.
 
bool Intersects (BoundingSphere sphere)
 Gets whether or not the other BoundingSphere intersects with this sphere.
 
void Intersects (ref BoundingSphere sphere, out bool result)
 Gets whether or not the other BoundingSphere intersects with this sphere.
 
PlaneIntersectionType Intersects (Plane plane)
 Gets whether or not a specified Plane intersects with this sphere.
 
void Intersects (ref Plane plane, out PlaneIntersectionType result)
 Gets whether or not a specified Plane intersects with this sphere.
 
float? Intersects (Ray ray)
 Gets whether or not a specified Ray intersects with this sphere.
 
void Intersects (ref Ray ray, out float? result)
 Gets whether or not a specified Ray intersects with this sphere.
 
override string ToString ()
 Returns a String representation of this BoundingSphere in the format: {Center:[Center] Radius:[Radius]}.
 
BoundingSphere Transform (Matrix matrix)
 Creates a new BoundingSphere that contains a transformation of translation and scale from this sphere by the specified Matrix.
 
void Transform (ref Matrix matrix, out BoundingSphere result)
 Creates a new BoundingSphere that contains a transformation of translation and scale from this sphere by the specified Matrix.
 
void Deconstruct (out Vector3 center, out float radius)
 Deconstruction method for BoundingSphere.
 

Static Public Member Functions

static BoundingSphere CreateFromBoundingBox (BoundingBox box)
 Creates the smallest BoundingSphere that can contain a specified BoundingBox.
 
static void CreateFromBoundingBox (ref BoundingBox box, out BoundingSphere result)
 Creates the smallest BoundingSphere that can contain a specified BoundingBox.
 
static BoundingSphere CreateFromFrustum (BoundingFrustum frustum)
 Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.
 
static BoundingSphere CreateFromPoints (IEnumerable< Vector3 > points)
 Creates the smallest BoundingSphere that can contain a specified list of points in 3D-space.
 
static BoundingSphere CreateMerged (BoundingSphere original, BoundingSphere additional)
 Creates the smallest BoundingSphere that can contain two spheres.
 
static void CreateMerged (ref BoundingSphere original, ref BoundingSphere additional, out BoundingSphere result)
 Creates the smallest BoundingSphere that can contain two spheres.
 
static bool operator== (BoundingSphere a, BoundingSphere b)
 Compares whether two BoundingSphere instances are equal.
 
static bool operator!= (BoundingSphere a, BoundingSphere b)
 Compares whether two BoundingSphere instances are not equal.
 

Public Attributes

Vector3 Center
 The sphere center.
 
float Radius
 The sphere radius.
 

Properties

string DebugDisplayString [get]
 

Constructor & Destructor Documentation

◆ BoundingSphere()

Mathf.BoundingSphere.BoundingSphere ( Vector3 center,
float radius )
inline

Constructs a bounding sphere with the specified center and radius.


Parameters
centerThe sphere center.
radiusThe sphere radius.

Member Function Documentation

◆ Contains() [1/8]

ContainmentType Mathf.BoundingSphere.Contains ( BoundingBox box)
inline

Test if a bounding box is fully inside, outside, or just intersecting the sphere.

Parameters
boxThe box for testing.
Returns
The containment type.

◆ Contains() [2/8]

ContainmentType Mathf.BoundingSphere.Contains ( BoundingFrustum frustum)
inline

Test if a frustum is fully inside, outside, or just intersecting the sphere.

Parameters
frustumThe frustum for testing.
Returns
The containment type.

◆ Contains() [3/8]

ContainmentType Mathf.BoundingSphere.Contains ( BoundingSphere sphere)
inline

Test if a sphere is fully inside, outside, or just intersecting the sphere.

Parameters
sphereThe other sphere for testing.
Returns
The containment type.

◆ Contains() [4/8]

void Mathf.BoundingSphere.Contains ( ref BoundingBox box,
out ContainmentType result )
inline

Test if a bounding box is fully inside, outside, or just intersecting the sphere.

Parameters
boxThe box for testing.
resultThe containment type as an output parameter.

◆ Contains() [5/8]

void Mathf.BoundingSphere.Contains ( ref BoundingFrustum frustum,
out ContainmentType result )
inline

Test if a frustum is fully inside, outside, or just intersecting the sphere.

Parameters
frustumThe frustum for testing.
resultThe containment type as an output parameter.

◆ Contains() [6/8]

void Mathf.BoundingSphere.Contains ( ref BoundingSphere sphere,
out ContainmentType result )
inline

Test if a sphere is fully inside, outside, or just intersecting the sphere.

Parameters
sphereThe other sphere for testing.
resultThe containment type as an output parameter.

◆ Contains() [7/8]

void Mathf.BoundingSphere.Contains ( ref Vector3 point,
out ContainmentType result )
inline

Test if a point is fully inside, outside, or just intersecting the sphere.

Parameters
pointThe vector in 3D-space for testing.
resultThe containment type as an output parameter.

◆ Contains() [8/8]

ContainmentType Mathf.BoundingSphere.Contains ( Vector3 point)
inline

Test if a point is fully inside, outside, or just intersecting the sphere.

Parameters
pointThe vector in 3D-space for testing.
Returns
The containment type.

◆ CreateFromBoundingBox() [1/2]

static BoundingSphere Mathf.BoundingSphere.CreateFromBoundingBox ( BoundingBox box)
inlinestatic

Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Parameters
boxThe box to create the sphere from.
Returns
The new BoundingSphere.

◆ CreateFromBoundingBox() [2/2]

static void Mathf.BoundingSphere.CreateFromBoundingBox ( ref BoundingBox box,
out BoundingSphere result )
inlinestatic

Creates the smallest BoundingSphere that can contain a specified BoundingBox.

Parameters
boxThe box to create the sphere from.
resultThe new BoundingSphere as an output parameter.

◆ CreateFromFrustum()

static BoundingSphere Mathf.BoundingSphere.CreateFromFrustum ( BoundingFrustum frustum)
inlinestatic

Creates the smallest BoundingSphere that can contain a specified BoundingFrustum.

Parameters
frustumThe frustum to create the sphere from.
Returns
The new BoundingSphere.

◆ CreateFromPoints()

static BoundingSphere Mathf.BoundingSphere.CreateFromPoints ( IEnumerable< Vector3 > points)
inlinestatic

Creates the smallest BoundingSphere that can contain a specified list of points in 3D-space.

Parameters
pointsList of point to create the sphere from.
Returns
The new BoundingSphere.

◆ CreateMerged() [1/2]

static BoundingSphere Mathf.BoundingSphere.CreateMerged ( BoundingSphere original,
BoundingSphere additional )
inlinestatic

Creates the smallest BoundingSphere that can contain two spheres.

Parameters
originalFirst sphere.
additionalSecond sphere.
Returns
The new BoundingSphere.

◆ CreateMerged() [2/2]

static void Mathf.BoundingSphere.CreateMerged ( ref BoundingSphere original,
ref BoundingSphere additional,
out BoundingSphere result )
inlinestatic

Creates the smallest BoundingSphere that can contain two spheres.

Parameters
originalFirst sphere.
additionalSecond sphere.
resultThe new BoundingSphere as an output parameter.

◆ Deconstruct()

void Mathf.BoundingSphere.Deconstruct ( out Vector3 center,
out float radius )
inline

Deconstruction method for BoundingSphere.

Parameters
center
radius

◆ Equals() [1/2]

bool Mathf.BoundingSphere.Equals ( BoundingSphere other)
inline

Compares whether current instance is equal to specified BoundingSphere.

Parameters
otherThe BoundingSphere to compare.
Returns
true if the instances are equal; false otherwise.

◆ Equals() [2/2]

override bool Mathf.BoundingSphere.Equals ( object obj)
inline

Compares whether current instance is equal to specified Object.

Parameters
objThe Object to compare.
Returns
true if the instances are equal; false otherwise.

◆ GetHashCode()

override int Mathf.BoundingSphere.GetHashCode ( )
inline

Gets the hash code of this BoundingSphere.

Returns
Hash code of this BoundingSphere.

◆ Intersects() [1/8]

bool Mathf.BoundingSphere.Intersects ( BoundingBox box)
inline

Gets whether or not a specified BoundingBox intersects with this sphere.

Parameters
boxThe box for testing.
Returns
true if BoundingBox intersects with this sphere; false otherwise.

◆ Intersects() [2/8]

bool Mathf.BoundingSphere.Intersects ( BoundingSphere sphere)
inline

Gets whether or not the other BoundingSphere intersects with this sphere.

Parameters
sphereThe other sphere for testing.
Returns
true if other BoundingSphere intersects with this sphere; false otherwise.

◆ Intersects() [3/8]

PlaneIntersectionType Mathf.BoundingSphere.Intersects ( Plane plane)
inline

Gets whether or not a specified Plane intersects with this sphere.

Parameters
planeThe plane for testing.
Returns
Type of intersection.

◆ Intersects() [4/8]

float? Mathf.BoundingSphere.Intersects ( Ray ray)
inline

Gets whether or not a specified Ray intersects with this sphere.

Parameters
rayThe ray for testing.
Returns
Distance of ray intersection or null if there is no intersection.

◆ Intersects() [5/8]

void Mathf.BoundingSphere.Intersects ( ref BoundingBox box,
out bool result )
inline

Gets whether or not a specified BoundingBox intersects with this sphere.

Parameters
boxThe box for testing.
resulttrue if BoundingBox intersects with this sphere; false otherwise. As an output parameter.

◆ Intersects() [6/8]

void Mathf.BoundingSphere.Intersects ( ref BoundingSphere sphere,
out bool result )
inline

Gets whether or not the other BoundingSphere intersects with this sphere.

Parameters
sphereThe other sphere for testing.
resulttrue if other BoundingSphere intersects with this sphere; false otherwise. As an output parameter.

◆ Intersects() [7/8]

void Mathf.BoundingSphere.Intersects ( ref Plane plane,
out PlaneIntersectionType result )
inline

Gets whether or not a specified Plane intersects with this sphere.

Parameters
planeThe plane for testing.
resultType of intersection as an output parameter.

◆ Intersects() [8/8]

void Mathf.BoundingSphere.Intersects ( ref Ray ray,
out float? result )
inline

Gets whether or not a specified Ray intersects with this sphere.

Parameters
rayThe ray for testing.
resultDistance of ray intersection or null if there is no intersection as an output parameter.

◆ operator!=()

static bool Mathf.BoundingSphere.operator!= ( BoundingSphere a,
BoundingSphere b )
inlinestatic

Compares whether two BoundingSphere instances are not equal.

Parameters
aBoundingSphere instance on the left of the not equal sign.
bBoundingSphere instance on the right of the not equal sign.
Returns
true if the instances are not equal; false otherwise.

◆ operator==()

static bool Mathf.BoundingSphere.operator== ( BoundingSphere a,
BoundingSphere b )
inlinestatic

Compares whether two BoundingSphere instances are equal.

Parameters
aBoundingSphere instance on the left of the equal sign.
bBoundingSphere instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

◆ ToString()

override string Mathf.BoundingSphere.ToString ( )
inline

Returns a String representation of this BoundingSphere in the format: {Center:[Center] Radius:[Radius]}.

Returns
A String representation of this BoundingSphere.

◆ Transform() [1/2]

BoundingSphere Mathf.BoundingSphere.Transform ( Matrix matrix)
inline

Creates a new BoundingSphere that contains a transformation of translation and scale from this sphere by the specified Matrix.

Parameters
matrixThe transformation Matrix.
Returns
Transformed BoundingSphere.

◆ Transform() [2/2]

void Mathf.BoundingSphere.Transform ( ref Matrix matrix,
out BoundingSphere result )
inline

Creates a new BoundingSphere that contains a transformation of translation and scale from this sphere by the specified Matrix.

Parameters
matrixThe transformation Matrix.
resultTransformed BoundingSphere as an output parameter.

Member Data Documentation

◆ Center

Vector3 Mathf.BoundingSphere.Center

The sphere center.

◆ Radius

float Mathf.BoundingSphere.Radius

The sphere radius.

Property Documentation

◆ DebugDisplayString

string Mathf.BoundingSphere.DebugDisplayString
getpackage

The documentation for this struct was generated from the following file: