Base layout for the input manager
This commit is contained in:
@ -1,66 +1,13 @@
|
||||
#include "AssetManager/ModelImporter.h"
|
||||
|
||||
|
||||
void ModelImporter::ImportFBX(std::string path)
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::Import(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportFBX not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportBlend(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportBlend not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportGLTF(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportGLTF not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::ImportOBJ(std::string path)
|
||||
{
|
||||
//spdlog::warn("ImportOBJ not implemented!");
|
||||
}
|
||||
|
||||
void ModelImporter::Import(std::string path)
|
||||
{
|
||||
//spdlog::warn("Import not implemented!");
|
||||
}
|
||||
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::Test() {
|
||||
|
||||
/*
|
||||
spdlog::info("====== Tiny GLTF ======");
|
||||
tinygltf::Model loadedModel;
|
||||
tinygltf::TinyGLTF loader;
|
||||
std::string error;
|
||||
std::string warn;
|
||||
bool ret = loader.LoadASCIIFromFile(&loadedModel, &error, &warn, "./Build/SandboxApplication/Debug/sponza.gltf");
|
||||
|
||||
if (!warn.empty())
|
||||
spdlog::warn("TinyGLTF Warning: {}", warn);
|
||||
if (!error.empty())
|
||||
spdlog::error("TinyGLTF Error: {}", error);
|
||||
if (!ret) {
|
||||
spdlog::error("TinyGLTF Error: Failed to parse glTF");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
spdlog::info("Meshes in model: {}", loadedModel.meshes.size());
|
||||
spdlog::info("Primitives in mesh: {}", loadedModel.meshes[0].primitives.size());
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//spdlog::info("======= Assimp ======");
|
||||
|
||||
Assimp::Importer importer;
|
||||
const aiScene* scene = importer.ReadFile("build/SandboxApplication/Debug/Models/Cube.obj", aiProcess_Triangulate | aiProcess_FlipUVs);
|
||||
|
||||
const aiScene* scene = importer.ReadFile(path.c_str(), aiProcess_Triangulate | aiProcess_FlipUVs);
|
||||
aiNode* currentNode = scene->mRootNode;
|
||||
|
||||
return processNode(currentNode, scene);
|
||||
|
||||
|
||||
return processNode(currentNode, scene);
|
||||
}
|
||||
|
||||
std::vector<BarinkEngine::Mesh> ModelImporter::processNode(aiNode* node, const aiScene* scene) {
|
||||
|
@ -3,14 +3,14 @@
|
||||
#include "PerfCounter.h"
|
||||
|
||||
|
||||
Renderable* Renderable::Load()
|
||||
Renderable* Renderable::Load(std::string& path)
|
||||
{
|
||||
return new Renderable();
|
||||
return new Renderable(path);
|
||||
}
|
||||
|
||||
Renderable::Renderable()
|
||||
Renderable::Renderable(std::string& path)
|
||||
{
|
||||
meshes = ModelImporter::Test();
|
||||
meshes = ModelImporter::Import(path);
|
||||
|
||||
transform.Scale = glm::vec3(1.0f);
|
||||
transform.Rotation = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
|
@ -79,6 +79,9 @@ void BarinkWindow::SwapBuffers()
|
||||
|
||||
void BarinkWindow::ReceiveEvent(Event& incident)
|
||||
{
|
||||
|
||||
|
||||
|
||||
std::cout << "EVENT RECEIVED: " << incident.name << std::endl;
|
||||
|
||||
}
|
Reference in New Issue
Block a user