BB is now in local space
This commit is contained in:
parent
5474c72876
commit
4c7b7cbd71
|
@ -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 {};
|
||||
|
|
Loading…
Reference in New Issue