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

@@ -101,6 +101,12 @@ extern "C"
return reinterpret_cast<TSceneAsset *>(instance);
}
EMSCRIPTEN_KEEPALIVE Aabb3 SceneAsset_getBoundingBox(TSceneAsset *tSceneAsset) {
auto *asset = reinterpret_cast<SceneAsset*>(tSceneAsset);
auto box = asset->getBoundingBox();
return Aabb3{box.center().x, box.center().y, box.center().z, box.extent().x, box.extent().y, box.extent().z};
}
#ifdef __cplusplus
}