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

@@ -1,6 +1,7 @@
#pragma once
#include <utils/Entity.h>
#include <filament/Box.h>
#include <filament/Engine.h>
#include <filament/Material.h>
#include <filament/MaterialInstance.h>
@@ -145,6 +146,10 @@ namespace thermion
math::mat4f getRotationForAxis(Gizmo::Axis axis);
const filament::Aabb getBoundingBox() const override {
return _boundingBox;
}
private:
SceneAsset *_source;
Engine *_engine;
@@ -161,6 +166,8 @@ namespace thermion
std::vector<utils::Entity> _entities;
std::vector<MaterialInstance *> _materialInstances;
filament::Aabb _boundingBox;
GizmoPickResultType getPickResult(utils::Entity entity)
{
if (entity.isNull())