Removing unused functions.
This commit is contained in:
parent
f770d0e973
commit
d225234640
@ -30,75 +30,6 @@
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/postprocess.h>
|
||||
|
||||
/*void AssetManager::loadOBJ(const std::string &path,
|
||||
const std::string &name)
|
||||
{
|
||||
std::vector<unsigned int> vertexIndices,
|
||||
uvIndices, normalIndices;
|
||||
std::vector<glm::vec3> temp_vertices;
|
||||
std::vector<glm::vec2> temp_uvs;
|
||||
std::vector<glm::vec3> temp_normals;
|
||||
|
||||
FILE *file = fopen(path.c_str(), "r");
|
||||
if(not file)
|
||||
{
|
||||
System::logger->writeError("Failed to open file.");
|
||||
return;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
char lineHeader[128];
|
||||
int res = fscanf(file, "%s", lineHeader);
|
||||
if(res == EOF)
|
||||
break;
|
||||
|
||||
if(strcmp(lineHeader, "v") == 0)
|
||||
{
|
||||
glm::vec3 vertex;
|
||||
fscanf(file, "%f %f %f\n",
|
||||
&vertex.x, &vertex.y, &vertex.z);
|
||||
temp_vertices.push_back(vertex);
|
||||
}
|
||||
else if(strcmp(lineHeader, "vt") == 0)
|
||||
{
|
||||
glm::vec2 uv;
|
||||
fscanf(file, "%f %f\n", &uv.x, &uv.y);
|
||||
temp_uvs.push_back(uv);
|
||||
}
|
||||
else if(strcmp(lineHeader, "vn") == 0)
|
||||
{
|
||||
glm::vec3 normal;
|
||||
fscanf(file, "%f %f %f\n",
|
||||
&normal.x, &normal.y, &normal.z);
|
||||
temp_normals.push_back(normal);
|
||||
}
|
||||
else if(strcmp(lineHeader, "f") == 0)
|
||||
{
|
||||
std::string v1, v2, v3;
|
||||
unsigned int vIndex[3], uvIndex[3], normIndex[3];
|
||||
int matches = fscanf(file,
|
||||
"%d/%d/%d %d/%d/%d %d/%d/%d\n",
|
||||
&vIndex[0], &uvIndex[0], &normIndex[0],
|
||||
&vIndex[1], &uvIndex[1], &normIndex[1],
|
||||
&vIndex[2], &uvIndex[2], &normIndex[2]);
|
||||
if(matches not_eq 9)
|
||||
{
|
||||
System::logger->writeError(
|
||||
"OBJ file is too complicated.");
|
||||
return;
|
||||
}
|
||||
|
||||
for(auto &i : vIndex)
|
||||
vertexIndices.push_back(i);
|
||||
for(auto &i : uvIndex)
|
||||
uvIndices.push_back(i);
|
||||
for(auto &i : normIndex)
|
||||
normalIndices.push_back(i);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
void AssetManager::loadModel(const std::string &path,
|
||||
const std::string &name)
|
||||
{
|
||||
|
@ -26,13 +26,10 @@
|
||||
class AssetManager {
|
||||
public:
|
||||
|
||||
/*void loadOBJ(const std::string &path,
|
||||
const std::string &name);*/
|
||||
void loadModel(const std::string &path,
|
||||
const std::string &name);
|
||||
std::shared_ptr<Model> getModel(const std::string &name);
|
||||
void unloadModel(const std::string &name);
|
||||
//void unloadOBJ(const std::string &name);
|
||||
private:
|
||||
std::map<std::string, std::shared_ptr<Model>> models;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user