-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlayer.h
More file actions
73 lines (62 loc) · 1.11 KB
/
Player.h
File metadata and controls
73 lines (62 loc) · 1.11 KB
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
#pragma once
#include <gl/glew.h>
#include <gl/freeglut.h>
#include <gl/freeglut_ext.h>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/gtc/matrix_transform.hpp>
struct Part {
glm::mat4 T1, T2;
glm::mat4 R;
glm::mat4 S;
glm::mat4 TRS;
float r, g, b;
void makePart(int type, bool leftPart);
};
class CPlayer {
public:
float angle_turn;
float x, y, z;
float dx, dy, dz;
float angle_swing;
bool liftend;
bool fall;
int m_nScore = 0;
Part head;
Part nose;
Part body;
Part arm_l, arm_r;
Part leg_l, leg_r;
glm::mat4 Turn;
glm::mat4 Move;
glm::mat4 Swing_l, Swing_r;
public:
CPlayer();
void Update();
void Locate();
void Swing();
void Walk_anim();
void Jump();
void Fall();
void get_angle();
};
//////////////////////////////////////////////////////////////////
#define CLIENT_NUM 2
#define BUFSIZE 256
struct InputData {
bool bUp = false;
bool bRight = false;
bool bLeft = false;
bool bDown = false;
bool bSpace = false;
};
struct PlayerMgr {
DWORD threadId;
CPlayer player;
bool Win;
bool mine = false;
bool bGameOver = false;
};
struct SendPlayerData {
InputData Input = {};
};