more refactoring

This commit is contained in:
Nick Fisher
2025-03-18 18:06:17 +08:00
parent 77fe40848b
commit 951f5daa2d
54 changed files with 19065 additions and 16751 deletions

View File

@@ -120,5 +120,16 @@ namespace thermion
}
return renderableManager->getFogEnabled(renderableInstance);
}
EMSCRIPTEN_KEEPALIVE Aabb3 RenderableManager_getAabb(TRenderableManager *tRenderableManager, EntityId entityId) {
auto *renderableManager = reinterpret_cast<filament::RenderableManager *>(tRenderableManager);
const auto &entity = utils::Entity::import(entityId);
auto renderableInstance = renderableManager->getInstance(entity);
if (!renderableInstance.isValid()) {
return false;
}
auto box = rm.getAxisAlignedBoundingBox(instance);
return Aabb3{box.center.x, box.center.y, box.center.z, box.halfExtent.x, box.halfExtent.y, box.halfExtent.z};
}
}
}