Difficulty getting FBox from StaticMeshComponent

Hello!

I’m looking for a way to calculate a tight FBox around a StaticMeshComponent that rotates with the component, keeping the same volume and orientation.

264526-bounding.png

Unfortunately, this capability is not available for FBox, which by nature is an Axis-Aligned Bounding Box.

For anyone looking to do something like this, I ended up using UStaticMeshComponent::OverlapComponent().
Code for overlapping a staticmesh with a foliage instance bounding box:

FCollisionShape QueryBox = FCollisionShape::MakeBox(InstanceBox.GetExtent());

return MeshIn.OverlapComponent(InstanceBox.GetCenter(), FQuat::Identity, QueryBox);