feat: remove bounding box from SceneAsset and create renderable wireframe bounding box in ThermionAsset

This commit is contained in:
Nick Fisher
2024-12-21 07:45:50 +08:00
parent 51bdca7158
commit 8d8acef481
13 changed files with 274 additions and 53 deletions

View File

@@ -53,14 +53,6 @@ namespace thermion
return _materialInstanceCount;
}
const Aabb getBoundingBox() const override
{
return Aabb {
.min = _boundingBox.getMin(), // center - halfExtent
.max = _boundingBox.getMax() // center + halfExtent
};
}
VertexBuffer *getVertexBuffer() const { return _vertexBuffer; }
IndexBuffer *getIndexBuffer() const { return _indexBuffer; }

View File

@@ -58,11 +58,6 @@ namespace thermion
None
};
const Aabb getBoundingBox() const override
{
return Aabb{};
}
typedef void (*GizmoPickCallback)(Gizmo::GizmoPickResultType result, float x, float y, float z);
void pick(uint32_t x, uint32_t y, GizmoPickCallback callback);

View File

@@ -78,10 +78,6 @@ namespace thermion
return _asset;
}
const Aabb getBoundingBox() const override {
return _asset->getBoundingBox();
}
void addAllEntities(Scene *scene) override
{
scene->addEntities(_asset->getEntities(), _asset->getEntityCount());

View File

@@ -43,10 +43,6 @@ namespace thermion
return std::nullptr_t();
};
const Aabb getBoundingBox() const override {
return _instance->getBoundingBox();
}
SceneAssetType getType() override
{
return SceneAsset::SceneAssetType::Gltf;

View File

@@ -36,11 +36,6 @@ public:
void setLayer(RenderableManager& rm, int layer) override;
const Aabb getBoundingBox() const override
{
return Aabb { };
}
size_t getInstanceCount() override { return _instances.size(); }
SceneAsset* getInstanceByEntity(utils::Entity entity) override;
SceneAsset* getInstanceAt(size_t index) override;

View File

@@ -23,8 +23,6 @@ class SceneAsset {
}
virtual const Aabb getBoundingBox() const = 0;
virtual SceneAssetType getType() = 0;
virtual utils::Entity getEntity() {