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

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

No files matched your search

@@ -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
}