This commit is contained in:
2022-04-24 22:12:07 +02:00
parent 40a1723544
commit 3cfdd7a3f2
43 changed files with 777 additions and 457 deletions

View File

@@ -18,11 +18,13 @@
#include <fstream>
#include "../src/definitions/models.h"
#include "../src/resources/TextureTypes.h"
#include "primitiveModel.h"
void processNode(aiNode *node, const aiScene *scene, Model *model);
Mesh processMesh(aiMesh *mesh, const aiScene *scene, Model *model);
std::vector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, uint8_t textureType, Mesh *mesh, Model *model);
std::vector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, uint8_t textureType, Mesh *mesh,
Model *model);
int main(int argc, char** argv) {
@@ -221,7 +223,9 @@ Mesh processMesh(aiMesh *mesh, const aiScene *scene, Model *model) {
return currentMesh;
}
std::vector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, uint8_t textureType, Mesh *mesh, Model *model) {
std::vector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, uint8_t textureType, Mesh *mesh,
Model *model)
{
std::vector<Texture> textures;
for(uint32_t i = 0; i < mat->GetTextureCount(type); i++) {

View File

@@ -3,23 +3,22 @@
#include <vector>
#include <string>
struct Texture {
struct Texture
{
std::string pathToTexture;
uint32_t textureType;
uint32_t m_textureId;
};
struct Mesh {
struct Mesh
{
std::vector<Vertex> vertices;
std::vector<uint32_t> indices;
std::vector<uint32_t> textureIds;
};
struct Model {
struct Model
{
std::vector<Texture> textures;
std::vector<Mesh> m_meshes;
std::string m_workingPath;