Optimize various engine code

This commit is contained in:
Wojtek Figat
2021-07-08 12:59:45 +02:00
parent e6ffcfb60d
commit 929476a322
3 changed files with 57 additions and 16 deletions

View File

@@ -182,10 +182,15 @@ void StaticModel::UpdateBounds()
{
if (Model && Model->IsLoaded())
{
Transform t = _transform;
t.Scale *= _boundsScale;
Matrix world;
t.GetWorld(world);
if (Math::IsOne(_boundsScale))
world = _world;
else
{
Transform t = _transform;
t.Scale *= _boundsScale;
t.GetWorld(world);
}
_box = Model->GetBox(world);
}
else