UKismetMathLibrary::MakeOrientedBox
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Creates an FOrientedBox — a rotated bounding box defined by a center, a rotation, and a per-axis half-extent. Use this when an axis-aligned FBox would not tightly fit a rotated object.
Caveats & Gotchas
- • FOrientedBox is not accepted by most engine spatial query APIs (overlap tests, traces, spatial hashing) which operate on axis-aligned FBox. When interfacing with those systems you must convert to an AABB first by using FOrientedBox::CalcAABB().
- • Extent is the half-size in the box's local coordinate frame **before** Orientation is applied. Confusing local-space extent with world-space dimensions leads to incorrectly sized boxes after rotation.
Signature
static ENGINE_API FOrientedBox MakeOrientedBox(FVector Origin, FRotator Orientation, FVector Extent); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Origin | FVector | The center of the box in world space. | — |
| Orientation | FRotator | The rotation of the box. | — |
| Extent | FVector | The half-size of the box in local space along each axis. | — |
Return Type
FOrientedBox Example
Create an oriented hitbox matching a rotated actor C++
FVector Center = MyActor->GetActorLocation();
FRotator Rot = MyActor->GetActorRotation();
FVector HalfExtent(80.f, 40.f, 100.f);
FOrientedBox OBB = UKismetMathLibrary::MakeOrientedBox(Center, Rot, HalfExtent);
// OBB is now aligned with MyActor's local axes Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?