]> git.sur5r.net Git - fstl/blob - src/vertex.h
New upstream version 0.9.4
[fstl] / src / vertex.h
1 #ifndef VEC3_H
2 #define VEC3_H
3
4 #include <QtOpenGL/QtOpenGL>
5
6 /*
7  *  Represents an optionally-indexed vertex in space
8  */
9 struct Vertex
10 {
11     Vertex() {}
12     Vertex(float x, float y, float z) : x(x), y(y), z(z) {}
13
14     GLfloat x, y, z;
15     GLuint i=0;
16
17     bool operator!=(const Vertex& rhs) const
18     {
19         return x != rhs.x || y != rhs.y || z != rhs.z;
20     }
21     bool operator<(const Vertex& rhs) const
22     {
23         if      (x != rhs.x)    return x < rhs.x;
24         else if (y != rhs.y)    return y < rhs.y;
25         else if (z != rhs.z)    return z < rhs.z;
26         else                    return false;
27     }
28 };
29
30 #endif