SP3-237 Added header data type into mesh asset in preparation for compilation of mesh

This commit is contained in:
Xiao Qi 2022-09-24 13:36:43 +08:00
parent cb73a8c5d1
commit a8a2e90c26
2 changed files with 19 additions and 1 deletions

View File

@ -5,8 +5,19 @@
namespace SHADE namespace SHADE
{ {
struct SHMeshAssetHeader
{
uint32_t vertexCount;
uint32_t indexCount;
};
struct SHMeshAsset struct SHMeshAsset
{ {
bool compiled;
bool changed;
SHMeshAssetHeader header;
std::vector<SHVec3> vertexPosition; std::vector<SHVec3> vertexPosition;
std::vector<SHVec2> texCoords; std::vector<SHVec2> texCoords;
std::vector<SHVec3> vertexTangent; std::vector<SHVec3> vertexTangent;

View File

@ -24,7 +24,11 @@ namespace SHADE
{ {
(void)scene; (void)scene;
SHMeshAsset result; SHMeshAsset result
{
.compiled = false,
.changed = false
};
for (size_t i{0}; i < mesh.mNumVertices; ++i) for (size_t i{0}; i < mesh.mNumVertices; ++i)
{ {
@ -74,6 +78,9 @@ namespace SHADE
} }
} }
result.header.vertexCount = result.vertexPosition.size();
result.header.indexCount = result.indices.size();
return result; return result;
} }