Fix spawning actors in viewport to have better origin placement
Empty Actor is a building block of hierarchies so don't include dummy bounds there. Wait for dragged asset to be loaded for proper bounds. Use mesh bounds for non-active Animated Model for accurate placement.
This commit is contained in:
@@ -1250,7 +1250,19 @@ BoundingBox AnimatedModel::GetEditorBoundingBox() const
|
||||
{
|
||||
if (SkinnedModel)
|
||||
SkinnedModel->WaitForLoaded(100);
|
||||
return BoundingBox::MakeScaled(_box, 1.0f / BoundsScale);
|
||||
BoundingBox box = _box;
|
||||
if (CustomBounds.GetSize().LengthSquared() <= 0.01f)
|
||||
{
|
||||
if (!IsDuringPlay())
|
||||
{
|
||||
Matrix world;
|
||||
GetLocalToWorldMatrix(world);
|
||||
box = SkinnedModel->GetBox(world);
|
||||
}
|
||||
else
|
||||
box = BoundingBox::MakeScaled(box, 1.0f / BoundsScale);
|
||||
}
|
||||
return box;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user