Add mesh bounds metadata
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user