21 ALL, MESH, ANIMATION, AUTO, NOTHING
30 std::cout <<
"\ndeleting " << vertices.size() <<
" DAE Vertexes...\n";
31 for (
auto vertex : vertices) {
38 std::vector<Vertex*> vertices;
39 std::vector<vec3> normals;
40 std::vector<vec2> texUVs;
41 std::vector<int> indices;
45 POLYLIST = -1, TRIANGLES = 3,
48 DAELoader(
const char* path, LOAD_TYPE type,
bool isLoad);
52 void Load(
const char* path, LOAD_TYPE type);
57 return m_skeletonData;
66 bool LoadSkin(
const XNode& root_s);
68 bool LoadSkeleton(
const XNode& root_s);
70 bool LoadGeometry(
const XNode& root_g, DAEMeshData* meshData);
75 void ReadPositions(
const XNode& data, std::vector<VertexSkinData*> vertexWeight, DAEMeshData* meshData)
const;
77 static void ReadNormals(
const XNode& data,
const std::string& normalsId, DAEMeshData* meshData);
79 static void ReadUVs(
const XNode& data,
const std::string& texCoordsId, DAEMeshData* meshData);
81 void AssembleVertices(
const XNode& data, DAEMeshData* meshData);
83 Vertex* processVertex(
int posIndex,
int normIndex,
int texIndex, DAEMeshData* meshData);
85 Vertex* dealWithAlreadyProcessedVertex(
Vertex* previousVertex,
int newTextureIndex,
int newNormalIndex,
86 DAEMeshData* meshData);
88 static void removeUnusedVertices(DAEMeshData* meshData);
90 void ConvertDataToVectors(DAEMeshData* meshData)
const;
95 static std::vector<std::string> loadJointsList(
const XNode& skinningData);
97 static std::vector<float> loadWeights(
const XNode& skinningData);
99 std::vector<int> getEffectiveJointsCounts(
const XNode& node);
101 std::vector<VertexSkinData*>
102 getSkinData(
const XNode& weightsDataNode,
const std::vector<int>& counts, std::vector<float> weights)
const;
108 Joint* loadJointData(
const XNode& jointNode,
bool isRoot);
110 Joint* extractMainJointData(
const XNode& jointNode,
bool isRoot);
112 void LoadTexturePath(
const XNode& imageNode);
115 static void AttachDataToObjSurface(
int vertices_size, std::vector<float> vertices, std::vector<float> normals,
116 std::vector<float> texUVs, std::vector<int> indices, std::vector<short> jointIDs,
117 std::vector<float> weights, DAEMeshData* meshData);
122 const XNode* m_root{};
124 std::vector<DAEMeshData*> m_meshList;
135 bool m_isSkinning =
false;
136 POLYGON_TYPE m_polygonType = POLYGON_TYPE::POLYLIST;
139 std::string m_texture_name;
141 std::string m_resource_id;