-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathObjectLoader.h
More file actions
29 lines (24 loc) · 841 Bytes
/
ObjectLoader.h
File metadata and controls
29 lines (24 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef OBJECTLOADER_H
#define OBJECTLOADER_H
#include <glm\glm.hpp>
#include <map>
#include <vector>
class ObjectLoader
{
public:
struct PackedVertex {
glm::vec3 position;
glm::vec2 uv;
glm::vec3 normal;
bool operator<(const PackedVertex that) const {
return memcmp((void*)this, (void*)&that, sizeof(PackedVertex)) > 0;
};
};
ObjectLoader();
~ObjectLoader();
void indexVBO(std::vector<glm::vec3>&, std::vector<glm::vec2>&, std::vector<glm::vec3>&, std::vector<unsigned int> &, std::vector<glm::vec3>&, std::vector<glm::vec2>&, std::vector<glm::vec3> &);
bool loadOBJ(const char*, std::vector < glm::vec3 >&, std::vector < glm::vec2 >&, std::vector < glm::vec3 >&);
private:
bool getSimilarVertexIndex_fast(PackedVertex&, std::map<PackedVertex, unsigned int>&, unsigned int&);
};
#endif