3 #include <boost/archive/text_iarchive.hpp> 4 #include <boost/archive/text_oarchive.hpp> 7 #include <glm/gtx/hash.hpp> 17 friend class boost::serialization::access;
18 template <
typename Archive>
19 void serialize(Archive& ar,
const unsigned int version) {
68 static double*
matxvec(
double** mat,
double* vec);
84 inline double getX()
const {
93 inline double getY()
const {
118 this->pos.x == v.
pos.x &&
119 this->pos.y == v.
pos.y &&
120 this->pos.z == v.
pos.z;
123 friend std::ostream& operator << (std::ostream& out,
Vertex * v);
133 bool operator() (
Vertex *
const & a,
Vertex * & b)
const{
148 size_t operator() (
Vertex *
const &v)
const{
149 std::hash<double> doubleHasher;
150 const size_t prime = 31;
152 hash = prime * hash + doubleHasher(v->
getX());
153 hash = prime * hash + doubleHasher(v->
getY());
154 hash = prime * hash + doubleHasher(v->
getZ());
glm::dvec3 normal
Vertex normal vector.
Definition: Vertex.h:36
Color4f color
Vertex color (RGBA)
Definition: Vertex.h:45
Vertex copy()
Copy the vertex.
Definition: Vertex.cpp:14
glm::dvec2 texcoords
Vertex texture coordinates.
Definition: Vertex.h:40
Class representing a color with 4 float components: RGBA.
Definition: Color4f.h:6
static double * matxvec(double **mat, double *vec)
Matrix x Vector multiplication.
Definition: Vertex.cpp:19
bool operator==(const Vertex &v) const
Compare if two vertex are equal.
Definition: Vertex.h:116
Struct to compare vertex when using unordered set.
Definition: Vertex.h:132
double getX() const
Get the X coordinate of vertex position.
Definition: Vertex.h:84
glm::dvec3 pos
Vertex 3D position.
Definition: Vertex.h:32
double getZ() const
Get the Z coordinate of vertex position.
Definition: Vertex.h:102
Vertex()=default
Default vertex constructor.
static Vertex rotateVertex(Vertex v, double **rotationMatrix)
Build a vertes result of rotating another vertex (v)
Definition: Vertex.cpp:33
Struct to obtain vertex hash when using unordered set.
Definition: Vertex.h:147
Class representing a vertex.
Definition: Vertex.h:14
double getY() const
Get the Y coordinate of vertex position.
Definition: Vertex.h:93