internal: add bounding box to SceneAsset & subclasses

This commit is contained in:
Nick Fisher
2024-12-11 21:04:57 +08:00
parent 27e150ebf6
commit 278575c3e2
5 changed files with 24 additions and 3 deletions

View File

@@ -53,7 +53,14 @@ namespace thermion
return _materialInstanceCount;
}
const Box &getBoundingBox() const { return _boundingBox; }
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; }
@@ -137,7 +144,6 @@ namespace thermion
utils::Entity _entity;
RenderableManager::PrimitiveType _primitiveType;
std::vector<std::unique_ptr<GeometrySceneAsset>> _instances;
};
} // namespace thermion