BB is now in local space

This commit is contained in:
doterop 2020-11-17 18:12:05 +01:00
parent 5474c72876
commit 4c7b7cbd71
1 changed files with 6 additions and 1 deletions

View File

@ -115,7 +115,12 @@ FBoundingBox UBoundingBoxCalculator::GetActorBoundingBox(const AActor *Actor, ui
}
// Other, by default BB
TArray<FBoundingBox> BBs = GetBBsOfActor(Actor);
return CombineBBs(BBs);
FBoundingBox BB = CombineBBs(BBs);
// Conver to local space; GetBBsOfActor return BBs in world space
FTransform Transform = Actor->GetTransform();
BB.Origin = Transform.InverseTransformPosition(BB.Origin);
BB.Rotation = Transform.InverseTransformRotation(BB.Rotation.Quaternion()).Rotator();
return BB;
}
return {};