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

@@ -1090,7 +1090,7 @@ void Actor::OnTransformChanged()
if (_parent)
{
_parent->GetTransform().LocalToWorld(_localTransform, _transform);
_parent->_transform.LocalToWorld(_localTransform, _transform);
}
else
{

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