a bit more
This commit is contained in:
17
src/mesh.cpp
17
src/mesh.cpp
@@ -5,17 +5,26 @@ Mesh::Mesh() {
|
||||
}
|
||||
|
||||
Mesh::Mesh(std::string objPath) {
|
||||
Logger logger;
|
||||
objl::Loader loader;
|
||||
bool canLoad = loader.LoadFile(objPath);
|
||||
|
||||
if (!canLoad) {
|
||||
logger << LOGGER_ERROR << "Cannot load obj '" << objPath << "'" << LOGGER_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
OBJLtoGLM(loader.LoadedMeshes[0].Vertices, vertices, normals, texCoords);
|
||||
}
|
||||
|
||||
Mesh::Mesh(objl::Mesh objMesh) {
|
||||
OBJLtoGLM(objMesh.Vertices, vertices, normals, texCoords);
|
||||
// objMesh.Vertices includes normals, positions and texcoords
|
||||
// it must convert them to the neccesary GLM shit
|
||||
UintToGLuint(objMesh.Indices, indices);
|
||||
}
|
||||
|
||||
void Mesh::loadFromObj(objl::Mesh objmesh) {
|
||||
|
||||
void Mesh::loadFromObj(objl::Mesh objMesh) {
|
||||
OBJLtoGLM(objMesh.Vertices, vertices, normals, texCoords);
|
||||
UintToGLuint(objMesh.Indices, indices);
|
||||
}
|
||||
|
||||
void Mesh::settup() {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <OBJLoader.h>
|
||||
|
||||
#include <logger.h>
|
||||
#include "./util/util.h"
|
||||
|
||||
class Shader;
|
||||
|
||||
12
src/model.h
12
src/model.h
@@ -0,0 +1,12 @@
|
||||
#ifndef SMHENGINE_SRC_MODEL_H_
|
||||
#define SMHENGINE_SRC_MODEL_H_
|
||||
|
||||
#include "mesh.h"
|
||||
#include "material.h"
|
||||
|
||||
class Mesh {
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user