-
Notifications
You must be signed in to change notification settings - Fork 0
/
modele.hpp
68 lines (45 loc) · 1.1 KB
/
modele.hpp
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MODEL_H
#define MODEL_H
#include <vector>
#include <map>
#include "material.hpp"
class Groupe;
class Modele
{
private:
std::map<const std::string, Groupe *> _groupes;
std::map<const std::string, Material *> _materials;
std::vector<GLfloat> _vertices;
std::vector<GLfloat> _normals;
std::vector<GLfloat> _texCoord;
bool _useTex;
public:
Modele(const std::string & file);
~Modele();
virtual void draw();
void useTex(bool b);
bool useTex(){return _useTex;}
private:
void loadMtl(const std::string & path);
void parse(const std::string & file);
};
class Groupe
{
private:
std::vector<GLfloat> *_vertices;
std::vector<GLfloat> *_normals;
std::vector<GLfloat> *_texCoord;
std::vector<unsigned int> _faces;
Material * _mat;
GLuint _callId;
bool _useTex;
public:
Groupe(std::vector<GLfloat> * vertices, std::vector<GLfloat> * normals, std::vector<GLfloat> * texCoord);
~Groupe();
void setMaterial(Material * m);
void addFace(unsigned int v, unsigned int n, unsigned int t);
void draw();
void useTex(bool b){_useTex = b;}
bool useTex(){return _useTex;}
};
#endif