-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvec3d.h
39 lines (34 loc) · 1019 Bytes
/
vec3d.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
//---------------------------------------------------------
// from https://www.youtube.com/watch?v=ih20l3pJoeU
//---------------------------------------------------------
#ifndef VEC3D_H
#define VEC3D_H
#include <QDebug>
#include <QVector3D>
//---------------------------------------------------------
class vec3d
{
public:
float x;
float y;
float z;
float w;
vec3d ();
vec3d (float, float, float, float);
vec3d (float, float, float);
vec3d (QString, QString, QString);
vec3d Vector_Add (vec3d&);
vec3d Vector_Sub (vec3d&);
vec3d Vector_Mul (float);
vec3d Vector_Div (float);
float Vector_DotProduct (vec3d&);
float Vector_Length ();
vec3d Vector_Normalise ();
vec3d Vector_CrossProduct (vec3d&);
vec3d Vector_IntersectPlane (vec3d&, vec3d&, vec3d&);
QPointF toPointF ();
QPoint toPoint ();
QVector3D toVector3D ();
friend QDebug operator<< (QDebug d, const vec3d& v);
};
#endif // VEC3D_H