Begining transition to tiny_obj_loader

This commit is contained in:
Ben
2019-02-25 14:01:33 +00:00
parent 5a64e58b0b
commit 55531371e3
5 changed files with 2573 additions and 1301 deletions

File diff suppressed because it is too large Load Diff

2564
include/tiny_obj_loader.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
// #include <glm/gtc/type_ptr.hpp>
// Custom includes
#define OBJL_IMPLIMENTATION
#define TINYOBJLOADER_IMPLEMENTATION
#define LOGGER_DEFINITION
#include <logger.h>

View File

@@ -6,8 +6,8 @@ Mesh::Mesh() {
Mesh::Mesh(std::string objPath) {
Logger logger;
objl::Loader loader;
bool canLoad = loader.LoadFile(objPath);
// objl::Loader loader;
// bool canLoad = loader.LoadFile(objPath);
if (!canLoad) {
logger << LOGGER_ERROR << "Cannot load obj '" << objPath << "'" << LOGGER_ENDL;
@@ -16,17 +16,17 @@ Mesh::Mesh(std::string objPath) {
logger << LOGGER_INFO << "Loaded: " << objPath << LOGGER_ENDL;
loadFromObj(loader.LoadedMeshes[0]);
// loadFromObj(loader.LoadedMeshes[0]);
}
Mesh::Mesh(objl::Mesh objMesh) {
loadFromObj(objMesh);
// loadFromObj(objMesh);
}
void Mesh::loadFromObj(objl::Mesh objMesh) {
OBJLtoGLM(objMesh.Vertices, vertices, normals, texCoords);
indices = objMesh.Indices;
name = objMesh.MeshName;
// OBJLtoGLM(objMesh.Vertices, vertices, normals, texCoords);
// indices = objMesh.Indices;
// name = objMesh.MeshName;
//Logger logger;
//for (int i = 0; i < 100; i++) {

View File

@@ -10,7 +10,7 @@
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <OBJLoader.h>
#include <tiny_obj_loader.h>
// #include <objectLoader.h>
#include <logger.h>