Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/engine/assets/include/mesh.hpp
2024-01-03 16:05:02 -05:00

47 lines
No EOL
849 B
C++

#pragma once
#include <asset.hpp>
#include <glm/glm.hpp>
#include <vector>
#include "model.hpp"
class Mesh : public Asset
{
public:
Mesh(int index)
{
m_index = index;
}
void Load(Renderer* renderer) override;
void Unload(Renderer* renderer) override;
std::string GetName() override
{
return m_parentAsset->GetName() + " (" + std::to_string(m_index) + ")";
}
std::type_index GetType() override
{
return typeid(Mesh);
}
int GetIndex()
{
return m_index;
}
std::vector<Vertex>& GetVertices()
{
return static_cast<Model*>(m_parentAsset)->submeshes[m_index].vertices;
}
std::vector<unsigned int>& GetIndices()
{
return static_cast<Model*>(m_parentAsset)->submeshes[m_index].indices;
}
private:
int m_index = 0;
};