-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mesh.h
41 lines (37 loc) · 1.27 KB
/
Mesh.h
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
#ifndef _MESH_H_
#define _MESH_H_ 1
#include <vector>
#include "Vector2.h"
#include "Vector3.h"
#include "Material.h"
/**
* this class defines a mesh class with a set of vertexs and normals and texture coordinates
*/
class Mesh{
public:
// constructors
Mesh(const std::vector<Vector3> &_vertex,const Material &_material);
Mesh(const std::vector<Vector3> &_vertex,const std::vector<Vector3> &_normal,const Material &_material);
Mesh(const std::vector<Vector3> &_vertex,const std::vector<Vector2> &_texCoord,const Material &_material);
Mesh(const std::vector<Vector3> &_vertex,const std::vector<Vector3> &_normal,const std::vector<Vector2> &_texCoord,const Material &_material);
Mesh(const Mesh &_orig);
void setVertex(int i,const Vector3 &_vertex);
Vector3 getVertex(int i)const;
int getVertexNum()const;
void setNormal(int i,const Vector3 &_normal);
Vector3 getNormal(int i)const;
int getNormalNum()const;
void setTexCoord(int i,const Vector2 &_texCoord);
Vector2 getTexCoord(int i)const;
int getTexCoordNum()const;
void setMaterial(const Material &_material);
Material getMaterial()const;
bool hasNormal()const;
bool hasTexCoord()const;
private:
std::vector<Vector3> vertex;
std::vector<Vector3> normal;
std::vector<Vector2> texCoord;
Material material;
};
#endif // _MESH_H_