Add mesh bounds metadata

This commit is contained in:
2026-03-26 03:26:44 +08:00
parent cb05472205
commit 6f1cbbf305
5 changed files with 48 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
#include <XCEngine/Core/Asset/IResource.h>
#include <XCEngine/Core/Containers/Array.h>
#include <XCEngine/Core/Math/Bounds.h>
#include <XCEngine/Core/Math/Vector2.h>
#include <XCEngine/Core/Math/Vector3.h>
#include <XCEngine/Core/Types.h>
@@ -42,6 +43,7 @@ struct MeshSection {
Core::uint32 startIndex;
Core::uint32 indexCount;
Core::uint32 materialID;
Math::Bounds bounds;
};
class Mesh : public IResource {
@@ -70,6 +72,9 @@ public:
size_t GetIndexDataSize() const { return m_indexData.Size(); }
Core::uint32 GetIndexCount() const { return m_indexCount; }
bool IsUse32BitIndex() const { return m_use32BitIndex; }
void SetBounds(const Math::Bounds& bounds) { m_bounds = bounds; }
const Math::Bounds& GetBounds() const { return m_bounds; }
void AddSection(const MeshSection& section);
const Containers::Array<MeshSection>& GetSections() const { return m_sections; }
@@ -87,6 +92,7 @@ private:
Containers::Array<Core::uint8> m_vertexData;
Containers::Array<Core::uint8> m_indexData;
Containers::Array<MeshSection> m_sections;
Math::Bounds m_bounds;
};
} // namespace Resources