-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvertex.h
47 lines (40 loc) · 1.48 KB
/
vertex.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
42
43
44
45
46
47
#ifndef VERTEX_H
#define VERTEX_H
#include "vector2d.h"
#include "vector3d.h"
/** Information class descibing a vertex (position, normal and uv of a point in a mesh).
* @brief Information class descibing a vertex (position, normal and uv of a point in a mesh).
*/
class Vertex {
public:
Vertex();
Vertex(float x, float y, float z, float r, float g, float b);
Vertex(gsl::Vector3D a);
Vertex(gsl::Vector3D a, gsl::Vector3D b, gsl::Vector2D c);
~Vertex();
//! Overloaded ostream operator which writes all vertex data on an open textfile stream
friend std::ostream& operator<< (std::ostream&, const Vertex&);
//! Overloaded ostream operator which reads all vertex data from an open textfile stream
friend std::istream& operator>> (std::istream&, Vertex&);
void set_xyz(GLfloat *xyz);
void set_xyz(GLfloat x, GLfloat y, GLfloat z);
void set_xyz(gsl::Vector3D xyz_in);
void set_rgb(GLfloat *rgb);
void set_rgb(GLfloat r, GLfloat g, GLfloat b);
void set_normal(GLfloat *normal);
void set_normal(GLfloat x, GLfloat y, GLfloat z);
void set_normal(gsl::Vector3D normal_in);
void set_st(GLfloat *st);
void set_st(GLfloat s, GLfloat t);
void set_uv(GLfloat u, GLfloat v);
gsl::vec3 get_xyz() const;
gsl::vec3 get_rgb() const;
gsl::vec3 get_normal() const;
gsl::vec2 get_uv() const;
gsl::vec2 get_st() const;
private:
gsl::Vector3D mXYZ;
gsl::Vector3D mNormal;
gsl::Vector2D mST;
};
#endif // VERTEX_H