2022-05-04 09:10:26 +00:00
|
|
|
#pragma once
|
|
|
|
#define TINYGLTF_IMPLEMENTATION
|
|
|
|
#define STB_IMAGE_IMPLEMENTATION
|
|
|
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
|
|
#define TINYGLTF_NO_EXTERNAL_IMAGE
|
|
|
|
|
2022-05-27 20:47:36 +00:00
|
|
|
#include "../MyGraphicsEngine/Mesh.h"
|
2022-05-04 21:25:18 +00:00
|
|
|
#include <assimp/Importer.hpp>
|
|
|
|
#include <assimp/scene.h>
|
|
|
|
#include <assimp/postprocess.h>
|
2022-05-04 09:10:26 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class ModelImporter {
|
|
|
|
private:
|
|
|
|
void ImportFBX(std::string path);
|
|
|
|
void ImportBlend(std::string path);
|
|
|
|
void ImportGLTF(std::string path);
|
|
|
|
void ImportOBJ(std::string path);
|
2022-05-04 21:25:18 +00:00
|
|
|
static BarinkEngine::Mesh ModelImporter::processMesh(aiMesh* mesh, const aiScene* scene);
|
|
|
|
static std::vector<BarinkEngine::Mesh> ModelImporter::processNode(aiNode* node, const aiScene* scene);
|
2022-05-04 09:10:26 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
void Import(std::string path);
|
|
|
|
|
2022-05-04 21:25:18 +00:00
|
|
|
static std::vector<BarinkEngine::Mesh> Test();
|
2022-05-04 09:10:26 +00:00
|
|
|
};
|