23template<
typename T,
typename TExtent>
128 template<
typename TFrom,
typename TExtentFrom UE_REQUIRES(!(std::is_same_v<T, TFrom> && std::is_same_v<TExtent, TExtentFrom>))>
139 if constexpr (std::is_same_v<T, float>)
144 else if constexpr (std::is_same_v<T, double>)
151 static_assert(
sizeof(T) == 0,
"Unimplemented");
193 return ::ComputeSquaredDistanceFromBoxToPoint(Mins,
Maxs,
Point);
206 return (
A.Origin -
B.Origin).SizeSquared() <=
FMath::Square(FMath::Max<TExtent>(0,
A.SphereRadius +
B.SphereRadius + Tolerance));
218 return A.GetBox().Intersect(
B.GetBox());
301#if ENABLE_NAN_DIAGNOSTIC
359 return BoxSphereBounds.IsSet();
372 *BoxSphereBounds = *BoxSphereBounds +
Other;
376 BoxSphereBounds.Emplace(
Other);
428template<
typename T,
typename TExtent>
453 DiagnosticCheckNaN();
456template<
typename T,
typename TExtent>
469 Result.SphereRadius = FMath::Min<TExtent>(Result.SphereRadius, FMath::Max<TExtent>((Origin - Result.Origin).Size() + SphereRadius, (
Other.Origin - Result.Origin).Size() +
Other.SphereRadius));
470 Result.DiagnosticCheckNaN();
475template<
typename T,
typename TExtent>
478 return Origin ==
Other.Origin && BoxExtent ==
Other.BoxExtent && SphereRadius ==
Other.SphereRadius;
481template<
typename T,
typename TExtent>
484 return !(*
this ==
Other);
487template<
typename T,
typename TExtent>
494template<
typename T,
typename TExtent>
497 return FString::Printf(
TEXT(
"Origin=%s, BoxExtent=(%s), SphereRadius=(%f)"), *Origin.
ToString(), *BoxExtent.
ToString(), SphereRadius);
500template<
typename T,
typename TExtent>
503#if ENABLE_NAN_DIAGNOSTIC
543 Result.DiagnosticCheckNaN();
553 template<
typename T,
typename TExtent>
556#if ENABLE_NAN_DIAGNOSTIC
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
EForceInit
Definition CoreMiscDefines.h:154
@ ForceInitToZero
Definition CoreMiscDefines.h:156
@ ForceInit
Definition CoreMiscDefines.h:155
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define logOrEnsureNanError(_FormatString_,...)
Definition LogMacros.h:436
@ LARGE_WORLD_COORDINATES
FORCEINLINE VectorRegister4Double VectorLoadFloat3(const double *Ptr)
Definition UnrealMathFPU.h:427
FORCEINLINE VectorRegister4Float VectorMultiply(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:758
FORCEINLINE VectorRegister4Float VectorMax(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:1713
#define VectorGetComponent(Vec, ComponentIndex)
Definition UnrealMathFPU.h:385
VectorRegister4Float VectorLoadAligned(const float *Ptr)
Definition UnrealMathFPU.h:451
FORCEINLINE VectorRegister4Float VectorMultiplyAdd(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2, const VectorRegister4Float &Vec3)
Definition UnrealMathFPU.h:786
FORCEINLINE VectorRegister4Float VectorAbs(const VectorRegister4Float &Vec)
Definition UnrealMathFPU.h:661
FORCEINLINE VectorRegister4Float VectorAdd(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:704
FORCEINLINE float VectorDot3Scalar(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:861
FORCEINLINE void VectorStoreFloat3(const VectorRegister4Float &Vec, float *Dst)
Definition UnrealMathFPU.h:594
#define VectorReplicate(Vec, ElementIndex)
Definition UnrealMathFPU.h:627
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
typename UE::Math::VectorRegisterPrivate::TVectorRegisterTypeHelper< T >::Type TVectorRegisterType
Definition VectorRegister.h:49
uint32 Size
Definition VulkanMemory.cpp:4034
bool ContainsNaN() const
Definition Vector.h:188
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT FPackageFileVersion UEVer() const
Definition Archive.h:204
Definition NameTypes.h:617
FArchive & operator<<(FArchive &Ar, TBoxSphereBounds< float, float > &Bounds)
Definition BoxSphereBounds.h:396
Definition AdvancedWidgetsModule.cpp:13
static constexpr UE_FORCEINLINE_HINT T Square(const T A)
Definition UnrealMathUtility.h:578
Definition IsPODType.h:12
@ Value
Definition IsPODType.h:13
Definition IsUECoreType.h:19
@ Value
Definition IsUECoreType.h:20
Definition Optional.h:131
Definition BoxSphereBounds.h:336
UE_FORCEINLINE_HINT Builder & operator+=(const TSphere< T > &Sphere)
Definition BoxSphereBounds.h:347
UE_FORCEINLINE_HINT Builder & operator+=(const TVector< T > &Point)
Definition BoxSphereBounds.h:352
UE_FORCEINLINE_HINT Builder & operator+=(const TBox< T > &Box)
Definition BoxSphereBounds.h:342
UE_FORCEINLINE_HINT Builder & operator+=(const TBoxSphereBounds< T, TExtent > &Other)
Definition BoxSphereBounds.h:337
UE_FORCEINLINE_HINT bool IsValid() const
Definition BoxSphereBounds.h:357
Definition BoxSphereBounds.h:25
UE_FORCEINLINE_HINT void DiagnosticCheckNaN() const
Definition BoxSphereBounds.h:321
TVector< T > GetBoxExtrema(uint32 Extrema) const
Definition BoxSphereBounds.h:237
TBoxSphereBounds(const TBoxSphereBounds< TFrom, TExtentFrom > &From)
Definition BoxSphereBounds.h:129
TBoxSphereBounds()=default
TBoxSphereBounds(EForceInit)
Definition BoxSphereBounds.h:47
TVector< TExtent > BoxExtent
Definition BoxSphereBounds.h:32
TBoxSphereBounds< T, TExtent > operator+(const TBoxSphereBounds< T, TExtent > &Other) const
Definition BoxSphereBounds.h:457
FString ToString() const
Definition BoxSphereBounds.h:495
UE_FORCEINLINE_HINT TBoxSphereBounds< T, TExtent > ExpandBy(TExtent ExpandAmount) const
Definition BoxSphereBounds.h:263
TBoxSphereBounds(const TVector< T > &InOrigin, const TVector< TExtent > &InBoxExtent, TExtent InSphereRadius)
Definition BoxSphereBounds.h:62
TBoxSphereBounds(const TVector< T > *Points, uint32 NumPoints)
Definition BoxSphereBounds.h:429
friend TBoxSphereBounds< T, TExtent > Union(const TBoxSphereBounds< T, TExtent > &A, const TBoxSphereBounds< T, TExtent > &B)
Definition BoxSphereBounds.h:296
TBoxSphereBounds(const TBox< T > &Box)
Definition BoxSphereBounds.h:94
TExtent SphereRadius
Definition BoxSphereBounds.h:35
static UE_FORCEINLINE_HINT bool SpheresIntersect(const TBoxSphereBounds< T, TExtent > &A, const TBoxSphereBounds< T, TExtent > &B, TExtent Tolerance=UE_KINDA_SMALL_NUMBER)
Definition BoxSphereBounds.h:204
bool ContainsNaN() const
Definition BoxSphereBounds.h:324
TBoxSphereBounds(const TBox< T > &Box, const TSphere< T > &Sphere)
Definition BoxSphereBounds.h:76
TBoxSphereBounds(const TSphere< T > &Sphere)
Definition BoxSphereBounds.h:108
bool SerializeFromMismatchedTag(FName StructTag, FArchive &Ar)
Definition BoxSphereBounds.h:137
TBoxSphereBounds< T, TExtent > TransformBy(const TMatrix< T > &M) const
Definition BoxSphereBounds.h:501
bool Serialize(FArchive &Ar)
Definition BoxSphereBounds.h:488
TBoxSphereBounds< T, TExtent > TransformBy(const TTransform< T > &M) const
Definition BoxSphereBounds.h:554
UE_FORCEINLINE_HINT bool operator!=(const TBoxSphereBounds< T, TExtent > &Other) const
Definition BoxSphereBounds.h:482
static UE_FORCEINLINE_HINT bool BoxesIntersect(const TBoxSphereBounds< T, TExtent > &A, const TBoxSphereBounds< T, TExtent > &B)
Definition BoxSphereBounds.h:216
UE_FORCEINLINE_HINT bool operator==(const TBoxSphereBounds< T, TExtent > &Other) const
Definition BoxSphereBounds.h:476
TVector< T > Origin
Definition BoxSphereBounds.h:29
UE_FORCEINLINE_HINT TSphere< T > GetSphere() const
Definition BoxSphereBounds.h:252
UE_FORCEINLINE_HINT TBox< T > GetBox() const
Definition BoxSphereBounds.h:226
T ComputeSquaredDistanceFromBoxToPoint(const TVector< T > &Point) const
Definition BoxSphereBounds.h:188
T FReal
Definition BoxSphereBounds.h:26
FString ToString() const
Definition Matrix.h:367
T M[4][4]
Definition Matrix.h:49
bool ContainsNaN() const
Definition Matrix.inl:586
FString ToString() const
Definition Vector.h:2304
bool ContainsNaN() const
Definition Vector.h:2296
T Size() const
Definition Vector.h:1716