-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMovingCube.hpp
48 lines (42 loc) · 1.35 KB
/
MovingCube.hpp
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
#ifndef __MOVINGCUBES_HPP_INCLUDED__
#define __MOVINGCUBES_HPP_INCLUDED__
#include <mutex>
#include <vector>
#include "sniffer.hpp"
#include "gframework/graphicsframework.hpp"
#include "NetworkEntities.hpp"
#include "resources.hpp"
class MovingCube
{
glObject* graphic;
NetworkEntity* destination_netent;
Attribute* att_position;
Attribute* att_color;
Attribute* att_scale;
int factor;
int move;
u_char *content;
bpf_u_int32 contentlength;
float distance;
public:
glm::vec3 destination();
int end;
glm::vec3 col_vector;
glm::vec3 position;
glm::vec3 sca_vector;
void printContent();
MovingCube(int dir,Attribute* coord, Attribute* texcoord, Attribute* texture, GLint unif_position, GLint color, GLint scale, glElement* elements, glm::vec3 color_vec, glm::vec3 scale_vector,const u_char* content, bpf_u_int32 contentlength);
~MovingCube();
int activate(int t_passed);
int update(int t_passed);
void draw();
void toogleHalt();
glObject* getObject();
};
extern std::vector<MovingCube*> movingCubes;
void addNewNetworkPackage(int direction, glm::vec3 color, glm::vec3 scale_vec, const u_char* content, bpf_u_int32 contentlength);
void drawNetworkPackages(int t_passed);
void* updateNetworkPackages(void* arg);
MovingCube* getNearestCube(glm::vec3 coords);
void init_MovingCubes();
#endif