UKismetMathLibrary::MakeBoxSphereBounds
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Constructs an FBoxSphereBounds from explicit origin, box half-extent, and sphere radius values. This combined bounds type is what UPrimitiveComponent uses for visibility culling and shadow casting.
Caveats & Gotchas
- • The engine does **not** derive SphereRadius from BoxExtent automatically — you must supply a value that actually encompasses the box (typically BoxExtent.Size()). Inconsistent sphere and box values cause visibility culling or shadow-rendering artifacts without any runtime warning.
- • BoxExtent is the half-size (same convention as FBox built with MakeBoxWithOrigin). Passing full dimensions doubles the intended box extent and will make the component appear larger than it is for culling purposes.
Signature
static UE_INL_API FBoxSphereBounds MakeBoxSphereBounds(FVector Origin, FVector BoxExtent, float SphereRadius); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Origin | FVector | The center of the bounds in world space. | — |
| BoxExtent | FVector | Half-extent of the axis-aligned box component. | — |
| SphereRadius | float | Radius of the bounding sphere component. | — |
Return Type
FBoxSphereBounds Example
Manually define bounds for a custom primitive component C++
FVector Center = GetComponentLocation();
FVector HalfExtent(100.f, 100.f, 50.f);
float Radius = HalfExtent.Size(); // sphere that encloses the box
FBoxSphereBounds MyBounds = UKismetMathLibrary::MakeBoxSphereBounds(Center, HalfExtent, Radius); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?