-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.h
82 lines (66 loc) · 1.2 KB
/
node.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
#ifndef __NODE_H__ //guard against cyclic dependancy
#define __NODE_H__
#include <vector>
#include "structs.h"
#include "Math/Hitbox.h"
#include "Math/math3D.h"
#include "materials.h"
using namespace std;
extern int getID();
//Main Node class
//Various node types
enum NodeType{
root,
group,
transformation,
model
};
//Various transformation types possible for a nodes
enum transformType{
Translate,
Rotate,
Scale
};
//various model types
enum ModelType{
Sphere,
Cube,
Cone,
Cylinder,
Torus,
Teapot,
Tetrahedron,
Octahedron,
Dodecahedron,
Icosahedron,
Custom
};
class Node{
public:
Node();
NodeType nodeType;
bool isDrawable;
int ID;
vector<Node*> *children;
Node* parent;
int currentChild;
bool current;
Hitbox hit;
ModelType modelType;
Vector3D amount3;
Vector4D amount4;
transformType transformationType;
transformType type;
vec3D tr;
vec3D sc;
quaternion rot;
vec3D xaxis,yaxis,zaxis;
vertex3D min,max;
bool method2;
cMaterial currentMat;
void draw();
virtual void nodeSpecificCodeDown();
virtual void nodeSpecificCodeUp();
//virtual void applyChangesAxes(vec3D transform);
};
#endif