forked from picciau-g/superfacets-2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
normals.h
executable file
·94 lines (81 loc) · 1.85 KB
/
normals.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
*
* 2014
* Author: Giulia Picciau - DIBRIS, Università degli studi di Genova
* Supervisors: Leila De Floriani - DIBRIS, Università degli studi di Genova
* Patricio Simari - Department of Electrical Engineering and Computer Science, The Catholic University of America
*
* Title: Fast and scalable mesh superfacets
* Submission to Pacific Graphics 2014
*
*
**/
#ifndef NORMALS_H
#define NORMALS_H
#include "Mesh.h"
#include "Vertex3D.h"
#include "Triangle.h"
/**
*
* @brief The Normals class stores information about the triangle normals
*
*/
class Normals
{
public:
Normals();
/// Constructor from 3 points
Normals(Vertex3D, Vertex3D, Vertex3D);
/// Scalar product
float dotProd(Normals N);
/// Vector Normalization
void Normalize();
/**
* @brief getNx
* @return x component of the normal vector
*/
inline float getNx(){
return this->nx;
}
/**
* @brief getNy
* @return y component of the normal vector
*/
inline float getNy(){
return this->ny;
}
/**
* @brief getNz
* @return z component of the normal vector
*/
inline float getNz(){
return this->nz;
}
/**
* @brief setNX set x component of the normal vector
* @param a value of the x component
*/
inline void setNX(float a){
this->nx=a;
}
/**
* @brief setNY set y component of the normal vector
* @param a value of the y component
*/
inline void setNY(float a){
this->ny=a;
}
/**
* @brief setNZ set z component of the normal vector
* @param a value of the z component
*/
inline void setNZ(float a){
this->nz=a;
}
private:
/// Values for the normal along the 3 axes
float nx;
float ny;
float nz;
};
#endif // NORMALS_H