chore: use XModelCommon for dumping obj to reduce code duplication

This commit is contained in:
Jan
2024-04-28 14:37:21 +02:00
parent 45684ac828
commit a39e993cc6
9 changed files with 477 additions and 965 deletions

View File

@ -6,12 +6,6 @@
#include <string>
#include <vector>
struct XModelObject
{
std::string name;
int materialIndex;
};
struct XModelBone
{
std::string name;
@ -51,7 +45,6 @@ struct XModelVertex
struct XModelFace
{
int vertexIndex[3];
int objectIndex;
};
struct XModelMaterial
@ -88,10 +81,19 @@ struct XModelMaterial
float blinn[2];
float phong;
std::string colorMapName;
std::string normalMapName;
std::string specularMapName;
void ApplyDefaults();
};
struct XModelObject
{
std::string name;
int materialIndex;
std::vector<XModelFace> m_faces;
};
struct XModelCommon
{
std::vector<XModelObject> m_objects;
@ -99,7 +101,6 @@ struct XModelCommon
std::vector<XModelMaterial> m_materials;
std::vector<XModelVertex> m_vertices;
std::vector<XModelVertexBoneWeights> m_vertex_bone_weights;
std::vector<XModelFace> m_faces;
XModelVertexBoneWeightCollection m_bone_weight_data;
};