UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Math::TSphere< T > Struct Template Reference

#include <Sphere.h>

Public Types

using FReal = T
 

Public Member Functions

 TSphere ()=default
 
 TSphere (int32)
 
 TSphere (TVector< T > InV, T InW)
 
 TSphere (EForceInit)
 
CORE_API TSphere (const TVector< T > *Points, int32 Count)
 
CORE_API TSphere (const TSphere< T > *Spheres, int32 Count)
 
template<typename FArg UE_REQUIRES>
 TSphere (const TSphere< FArg > &From)
 
bool Equals (const TSphere< T > &Sphere, T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
bool operator== (const TSphere< T > &Other) const
 
bool operator!= (const TSphere< T > &Other) const
 
TSphere< T > operator+ (const TSphere< T > &Other) const
 
TSphere< T > & operator+= (const TSphere< T > &Other)
 
bool IsInside (const TSphere< T > &Other, T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
bool IsInside (const FVector &In, T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
UE_FORCEINLINE_HINT bool Intersects (const TSphere< T > &Other, T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
TSphere< T > TransformBy (const TMatrix< T > &M) const
 
TSphere< T > TransformBy (const FTransform &M) const
 
GetVolume () const
 
FString ToString () const
 
bool Serialize (FArchive &Ar)
 
bool SerializeFromMismatchedTag (FName StructTag, FArchive &Ar)
 
 TSphere (const TVector< float > *Points, int32 Count)
 
 TSphere (const TVector< double > *Points, int32 Count)
 
 TSphere (const TSphere< float > *Spheres, int32 Count)
 
 TSphere (const TSphere< double > *Spheres, int32 Count)
 
CORE_API TSphere (const TVector< float > *Points, int32 Count)
 
CORE_API TSphere (const TVector< double > *Points, int32 Count)
 
CORE_API TSphere (const TSphere< float > *Spheres, int32 Count)
 
CORE_API TSphere (const TSphere< double > *Spheres, int32 Count)
 

Public Attributes

TVector< T > Center
 
W
 

Member Typedef Documentation

◆ FReal

template<typename T >
using UE::Math::TSphere< T >::FReal = T

Constructor & Destructor Documentation

◆ TSphere() [1/15]

template<typename T >
UE::Math::TSphere< T >::TSphere ( )
default

Default constructor (no initialization).

◆ TSphere() [2/15]

template<typename T >
UE::Math::TSphere< T >::TSphere ( int32  )
inline

Creates and initializes a new sphere.

Parameters
int32Passing int32 sets up zeroed sphere.

◆ TSphere() [3/15]

template<typename T >
UE::Math::TSphere< T >::TSphere ( TVector< T >  InV,
InW 
)
inline

Creates and initializes a new sphere with the specified parameters.

Parameters
InVCenter of sphere.
InWRadius of sphere.

◆ TSphere() [4/15]

template<typename T >
UE::Math::TSphere< T >::TSphere ( EForceInit  )
inlineexplicit

Constructor.

Parameters
EForceInitForce Init Enum.

◆ TSphere() [5/15]

template<typename T >
CORE_API UE::Math::TSphere< T >::TSphere ( const TVector< T > *  Points,
int32  Count 
)

Constructor.

Parameters
PointsPointer to list of points this sphere must contain.
CountHow many points are in the list.

◆ TSphere() [6/15]

template<typename T >
CORE_API UE::Math::TSphere< T >::TSphere ( const TSphere< T > *  Spheres,
int32  Count 
)

Constructor.

Parameters
SpheresPointer to list of spheres this sphere must contain.
CountHow many points are in the list.

◆ TSphere() [7/15]

template<typename T >
template<typename FArg UE_REQUIRES>
UE::Math::TSphere< T >::TSphere ( const TSphere< FArg > &  From)
inlineexplicit

◆ TSphere() [8/15]

UE::Math::TSphere< float >::TSphere ( const TVector< float > *  Points,
int32  Count 
)

◆ TSphere() [9/15]

UE::Math::TSphere< double >::TSphere ( const TVector< double > *  Points,
int32  Count 
)

◆ TSphere() [10/15]

UE::Math::TSphere< float >::TSphere ( const TSphere< float > *  Spheres,
int32  Count 
)

◆ TSphere() [11/15]

UE::Math::TSphere< double >::TSphere ( const TSphere< double > *  Spheres,
int32  Count 
)

◆ TSphere() [12/15]

CORE_API UE::Math::TSphere< float >::TSphere ( const TVector< float > *  Points,
int32  Count 
)

◆ TSphere() [13/15]

CORE_API UE::Math::TSphere< double >::TSphere ( const TVector< double > *  Points,
int32  Count 
)

◆ TSphere() [14/15]

CORE_API UE::Math::TSphere< float >::TSphere ( const TSphere< float > *  Spheres,
int32  Count 
)

◆ TSphere() [15/15]

CORE_API UE::Math::TSphere< double >::TSphere ( const TSphere< double > *  Spheres,
int32  Count 
)

Member Function Documentation

◆ Equals()

template<typename T >
bool UE::Math::TSphere< T >::Equals ( const TSphere< T > &  Sphere,
Tolerance = UE_KINDA_SMALL_NUMBER 
) const
inline

Check whether two spheres are the same within specified tolerance.

Parameters
SphereThe other sphere.
ToleranceError Tolerance.
Returns
true if spheres are equal within specified tolerance, otherwise false.

◆ GetVolume()

template<typename T >
T UE::Math::TSphere< T >::GetVolume ( ) const
inline

Get volume of the current sphere

Returns
Volume (in Unreal units).

◆ Intersects()

template<typename T >
UE_FORCEINLINE_HINT bool UE::Math::TSphere< T >::Intersects ( const TSphere< T > &  Other,
Tolerance = UE_KINDA_SMALL_NUMBER 
) const
inline

Test whether this sphere intersects another.

Parameters
OtherThe other sphere.
ToleranceError tolerance.
Returns
true if spheres intersect, false otherwise.

◆ IsInside() [1/2]

template<typename T >
bool UE::Math::TSphere< T >::IsInside ( const FVector In,
Tolerance = UE_KINDA_SMALL_NUMBER 
) const
inline

Checks whether the given location is inside this sphere.

Parameters
InThe location to test for inside the bounding volume.
Returns
true if location is inside this volume.

◆ IsInside() [2/2]

template<typename T >
bool UE::Math::TSphere< T >::IsInside ( const TSphere< T > &  Other,
Tolerance = UE_KINDA_SMALL_NUMBER 
) const
inline

Check whether sphere is inside of another.

Parameters
OtherThe other sphere.
ToleranceError Tolerance.
Returns
true if sphere is inside another, otherwise false.

◆ operator!=()

template<typename T >
bool UE::Math::TSphere< T >::operator!= ( const TSphere< T > &  Other) const
inline

Compares two spheres for inequality.

Parameters
OtherThe other sphere to compare with.
Returns
true if the spheres are not equal, false otherwise.

◆ operator+()

template<typename T >
TSphere< T > UE::Math::TSphere< T >::operator+ ( const TSphere< T > &  Other) const
inline

Gets the result of addition to this bounding volume.

Parameters
OtherThe other volume to add to this.
Returns
A new bounding volume.

◆ operator+=()

template<typename T >
TSphere< T > & UE::Math::TSphere< T >::operator+= ( const TSphere< T > &  Other)

Adds to this sphere to include a new bounding volume.

Parameters
Otherthe bounding volume to increase the bounding volume to.
Returns
Reference to this bounding volume after resizing to include the other bounding volume.

◆ operator==()

template<typename T >
bool UE::Math::TSphere< T >::operator== ( const TSphere< T > &  Other) const
inline

Compares two spheres for equality.

Parameters
OtherThe other sphere to compare with.
Returns
true if the spheres are equal, false otherwise.

◆ Serialize()

template<typename T >
bool UE::Math::TSphere< T >::Serialize ( FArchive Ar)
inline

◆ SerializeFromMismatchedTag()

template<typename T >
bool UE::Math::TSphere< T >::SerializeFromMismatchedTag ( FName  StructTag,
FArchive Ar 
)
inline

◆ ToString()

template<typename T >
FString UE::Math::TSphere< T >::ToString ( ) const
inline

Get a textual representation of the sphere.

Returns
Text describing the sphere.

◆ TransformBy() [1/2]

template<typename T >
TSphere< T > UE::Math::TSphere< T >::TransformBy ( const FTransform M) const

Get result of Transforming sphere with Transform.

Parameters
MTransform information.
Returns
Result of transformation.

◆ TransformBy() [2/2]

template<typename T >
TSphere< T > UE::Math::TSphere< T >::TransformBy ( const TMatrix< T > &  M) const

Get result of Transforming sphere by Matrix.

Parameters
MMatrix to transform by.
Returns
Result of transformation.

Member Data Documentation

◆ Center

template<typename T >
TVector<T> UE::Math::TSphere< T >::Center

The sphere's center point.

◆ W

template<typename T >
T UE::Math::TSphere< T >::W

The sphere's radius.


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