-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameProtocol.h
45 lines (33 loc) · 860 Bytes
/
GameProtocol.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
#include "Types.h"
#define NEW_PLAYER_PACKET 32
#define STATE_UPDATE_PACKET 42
#define CLIENT_MOVEMENT_PACKET 52
#define CREATE_BULLET_PACKET 62
typedef struct StateUpdatePacket StateUpdatePacket;
struct StateUpdatePacket
{
char packetType;
int numPlanes;
int selfPlane;
Pose3D planesPoses[MAX_NUM_AIRPLANES];
Vector3D planesVelocities[MAX_NUM_AIRPLANES];
Vector3D planesAccelerations[MAX_NUM_AIRPLANES];
Orientation3D planesAngularVelocities[MAX_NUM_AIRPLANES];
};
typedef struct ClientMovementPacket ClientMovementPacket;
struct ClientMovementPacket
{
char packetType;
int planeNum;
Pose3D planePose;
Vector3D planeVelocity;
Vector3D planeAcceleration;
Orientation3D planeAngularVelocity;
};
typedef struct BulletPacket BulletPacket;
struct BulletPacket
{
char packetType;
Vector3D bulletPosition;
Vector3D bulletVelocity;
};