Get world space Oriented Boundin Box 8 points in unreal (C++)

Viewed 18

Does anybody know how to retrieve an actor's world space oriented bounding box 8 points in C++. Im reading the official documentation but it's a bit vague as it never specifies whether the bounds objects (FBox, FBoxShpereBounds) are local space, world space, axis aligned etc

I'm thinking something like below but I'm not sure if that's right

    UStaticMeshComponent* pMesh = Cast<UStaticMeshComponent>(actor->GetComponentByClass(UStaticMeshComponent::StaticClass()));
        if (pMesh)
        {
            UStaticMesh* pStaticMesh = pMesh->GetStaticMesh();
    
            if (pStaticMesh && pStaticMesh->GetRenderData())
            {
                FStaticMeshRenderData* pRenderData = pStaticMesh->GetRenderData();
                if (pRenderData)
                FBoxSphereBounds bounds = pRenderData->Bounds;
bounds.TransformBy(actor>GetActorTransform());
    
    }
    }
0 Answers
Related