YoggieEngine/BarinkEngine/Include/AssetManager/ModelImporter.h

35 lines
810 B
C
Raw Normal View History

#pragma once
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define TINYGLTF_IMPLEMENTATION
#define TINYGLTF_NO_EXTERNAL_IMAGE
#include "Graphics/Mesh.h"
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <string>
#include "Scene/SceneNodeTypes.h"
void ProcessVertices(aiMesh* mesh, std::vector<BarinkEngine::Vertex>& out_vertices);
void ProcessIndices(aiMesh* mesh, std::vector<unsigned int>& out_indices);
2022-07-09 20:21:56 +00:00
namespace BarinkEngine {
class ModelImporter {
2022-07-09 20:21:56 +00:00
public:
2022-07-09 20:21:56 +00:00
SceneObject* Import(const std::string path);
2022-07-09 20:21:56 +00:00
private:
2022-07-09 20:21:56 +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-07-09 20:21:56 +00:00
};
}