-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvertex_3.h
53 lines (41 loc) · 1.44 KB
/
vertex_3.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
#ifndef VERTEX_3_H
#define VERTEX_3_H
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class vertex_3
{
public:
float x;
float y;
float z;
vertex_3(void);
// Add a pair of vertex_3 objects
const vertex_3& operator+(const vertex_3 &) const;
// Is this equal to that?
bool operator==(const vertex_3 &) const;
// Subtract vertex_3 from vertex_3
const vertex_3& operator-(const vertex_3 &) const;
// Is this smaller than that?
bool operator<(const vertex_3 &) const;
//Multiply a pair of vertex_3s together, I thinks.
const float dot(vertex_3 &) const;
// Square myself
const float self_dot(void) const;
//Sqrt myself squared ?
const float length(void) const;
// Divide by x,y,z by length(void).
void normalize(void);
// Define a crossing vertex 3 between the other guy and me?
const vertex_3& cross(const vertex_3 &) const;
};
#endif