UKismetMathLibrary::BreakBoxSphereBounds
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Decomposes an FBoxSphereBounds into its origin, box half-extent, and sphere radius components. Use this to extract individual values from the bounds returned by UPrimitiveComponent::GetLocalBounds or CalcBounds.
Caveats & Gotchas
- • Origin is the **center** of the bounds, not the Min corner of the box. Confusing it with FBox::Min — which is Origin - BoxExtent — causes an off-by-extent translation error when rebuilding geometry.
- • BoxExtent is the half-size along each axis. To get the full per-axis dimensions, multiply by 2. The sphere radius is independent and may not equal BoxExtent.Size() if the original bounds were authored manually.
Signature
static UE_INL_API void BreakBoxSphereBounds(const FBoxSphereBounds& InBoxSphereBounds, FVector& Origin, FVector& BoxExtent, float& SphereRadius); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InBoxSphereBounds | const FBoxSphereBounds& | The bounds structure to decompose. | — |
| Origin | FVector& | Receives the center of the bounds. | — |
| BoxExtent | FVector& | Receives the half-extent of the box component. | — |
| SphereRadius | float& | Receives the bounding sphere radius. | — |
Return Type
void Example
Extract component bounds and use them for a proximity sphere check C++
FBoxSphereBounds Bounds = MyMeshComp->CalcBounds(MyMeshComp->GetComponentTransform());
FVector Center;
FVector HalfExtent;
float Radius;
UKismetMathLibrary::BreakBoxSphereBounds(Bounds, Center, HalfExtent, Radius);
// Radius is the sphere that fully encloses the mesh Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?