Fixes and tweaks

This commit is contained in:
Wojtek Figat
2021-02-02 12:52:37 +01:00
parent d2dba5680b
commit 85a6f485f1
5 changed files with 20 additions and 18 deletions

View File

@@ -327,14 +327,6 @@ void AnimatedModel::SyncParameters()
}
}
void AnimatedModel::UpdateBounds()
{
UpdateLocalBounds();
BoundingBox::Transform(_boxLocal, _world, _box);
BoundingSphere::FromBox(_box, _sphere);
}
void AnimatedModel::BeginPlay(SceneBeginData* data)
{
if (SkinnedModel && SkinnedModel->IsLoaded())
@@ -401,6 +393,14 @@ void AnimatedModel::UpdateLocalBounds()
_boxLocal = box;
}
void AnimatedModel::UpdateBounds()
{
UpdateLocalBounds();
BoundingBox::Transform(_boxLocal, _world, _box);
BoundingSphere::FromBox(_box, _sphere);
}
void AnimatedModel::OnAnimUpdate()
{
UpdateBounds();