internal: store bounding box with SceneAsset rather than recalculating from renderables

This commit is contained in:
Nick Fisher
2025-01-07 12:02:44 +08:00
parent 124eed0264
commit 0e5253f7b3
12 changed files with 78 additions and 25 deletions

View File

@@ -26,7 +26,10 @@ namespace thermion
}
TRACE("Creating instance %d", instanceNumber);
auto instance = _asset->getAssetInstances()[instanceNumber];
instance->recomputeBoundingBoxes();
auto bb = instance->getBoundingBox();
TRACE("Instance bounding box center (%f,%f,%f), extent (%f,%f,%f)", bb.center().x, bb.center().y, bb.center().z, bb.extent().x,bb.extent().y,bb.extent().z);
instance->getAnimator()->updateBoneMatrices();
auto& rm = _engine->getRenderableManager();