123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef CLIENT_H
- #define CLIENT_H
- #include "../engine/Wrapper.h"
- #include "../engine/KeyManager.h"
- #include "../engine/MouseManager.h"
- #include "../engine/Clock.h"
- #include "../engine/Shader.h"
- #include "../engine/DirectRenderer.h"
- #include "../math/Camera3D.h"
- #include "../world/World.h"
- #include "../world/IChunkProvider.h"
- #include "rendering/ClientChunkProvider.h"
- #include "rendering/ChunkRenderer.h"
- using namespace std;
- class Client : public IClient
- {
- public:
- Client();
- virtual ~Client();
-
- void tick() override;
- void render3DTick(float lag) override;
- void render2DTick(float lag) override;
- void onKeyEvent(int key, int scancode, int action, int mods) override;
- void onMouseClick(int button, int action, int mods) override;
- private:
- static const int KEY_LEFT = 0;
- static const int KEY_RIGHT = 1;
- static const int KEY_UP = 2;
- static const int KEY_DOWN = 3;
- static const int KEY_JUMP = 4;
- static const int KEY_SNEAK = 5;
-
- static const int KEY_CAM_LEFT = 6;
- static const int KEY_CAM_RIGHT = 7;
- static const int KEY_CAM_UP = 8;
- static const int KEY_CAM_DOWN = 9;
-
- static const int KEY_CAM_TEST = 10;
-
- static const int MOUSE_LEFT = 0;
-
- Clock tps;
- Clock fps;
-
- KeyManager keyManager;
- MouseManager mouseManager;
-
- ChunkRenderer chunkRenderer;
- ClientChunkProvider chunkProvider;
- World world;
-
- Camera3D camera;
- Shader shader;
- DirectRenderer directRenderer;
- Vector3D position;
- float lengthAngle = 0;
- float widthAngle = 0;
- };
- #endif
|