32 Mesh(std::shared_ptr<VertexBuffer> vertexBuffer, std::shared_ptr<IndexBuffer> indexBuffer,
const std::string& meshName =
"NoName",
33 MeshType mType = MeshType::Mesh);
34 Mesh(
const std::string& filePath);
36 virtual void ProcessMesh(aiMesh* meshToProcess);
37 static std::shared_ptr<Mesh> ProcessTheRawMesh(aiMesh* meshToProcess,
const std::string& mName =
"NoName");
38 static void DealVertexIndexBufferData(
float*& vertexData, uint32_t& vertexDataSize, uint32_t*& indexData, uint32_t& indexDataLength,
41 void ProcessNode(aiNode* nodeToProcess,
const aiScene* theScene);
43 static void GaugeVertexDataLayout(aiMesh* meshToProcess,
BufferLayout& buffLayout);
45 std::shared_ptr<VertexBuffer> GetVertexBuffer()
const {
return m_VertexBuffer; }
46 std::shared_ptr<IndexBuffer> GetIndexBuffer()
const {
return m_IndexBuffer; }
48 void SetVertexBuffer(std::shared_ptr<VertexBuffer> vBuffer) { m_VertexBuffer = vBuffer; }
49 void SetIndexBuffer(std::shared_ptr<IndexBuffer> iBuffer) { m_IndexBuffer = iBuffer; }
52 static float LayoutElementToAttributeValue(
unsigned int vertexNumber, uint32_t counter, aiMesh* meshToProcess,
const BufferElement& layoutElem);
53 static void InitializeAttributeDictionary();
56 std::shared_ptr<VertexBuffer> m_VertexBuffer;
57 std::shared_ptr<IndexBuffer> m_IndexBuffer;
59 std::string m_MeshName;
62 static std::shared_ptr<std::unordered_map<std::string, MeshAttribute>> m_NameToAttributeDictionary;