This commit is contained in:
Joshua Ashton 2022-08-12 12:28:36 +00:00
parent c70779bfff
commit 97008e92ca
1 changed files with 11 additions and 3 deletions

View File

@ -69,9 +69,9 @@ struct SkinnedVertex : public StaticVertex
Array<uint8_t, MaxVertexWeights> boneWeights;
};
struct MeshData
struct MeshVertexData
{
MeshData(MeshVertexType type)
MeshVertexData(MeshVertexType type)
: vertexType(type)
{
switch(type)
@ -99,6 +99,14 @@ struct MeshData
MeshVertexType vertexType;
Variant<Vector<StaticVertex>, Vector<SkinnedVertex>> vertices;
};
struct MeshData
{
MeshData(MeshVertexType type)
: vertexData{ type } {}
MeshVertexData vertexData;
Vector<uint16_t> indices;
AABB bounds;
};
@ -177,7 +185,7 @@ Result<MeshData> ParseOBJ(StringView buffer)
.normal = indices[i][2] != -1 ? normals [indices[i][2]] : vec3{},
};
auto& vertices = data.GetStaticVertices();
auto& vertices = data.vertexData.GetStaticVertices();
size_t vertexIdx = vertices.FindIdx(vertex);
if (vertexIdx == vertices.InvalidIdx)