SQCSimulator2023/SQCSim2021/remoteplayer.h

42 lines
1.1 KiB
C
Raw Normal View History

2023-10-03 12:43:54 -04:00
#ifndef REMOTEPLAYER_H__
#define REMOTEPLAYER_H__
#include "../SQCSim-common/player.h"
#include "../SQCSim-common/netprotocol.h"
#include "define.h"
#include "textureatlas.h"
#include "shader.h"
2023-11-13 16:02:13 -05:00
#include "texture.h"
#include "openglcontext.h"
2023-11-18 14:16:24 -05:00
#include "vertexbuffer.h"
#include "../SQCSim-common/matrix4.h"
2023-10-03 12:43:54 -04:00
class RemotePlayer : public Player {
public:
enum Anim: uint8_t { STILL = 1, RUNNING = 2, JUMPING = 4, SHOOTING = 8, POWERUP = 16, DEAD = 32 }; // A REVOIR VOIR DEFINE.H POUR LES ANIMES
2023-11-13 16:02:13 -05:00
2023-10-27 14:37:53 -04:00
RemotePlayer(netprot::PlayerInfo pinfo);
2023-11-19 16:46:13 -05:00
RemotePlayer(netprot::PlayerInfo pinfo, const Vector3f& pos);
2023-11-13 16:02:13 -05:00
~RemotePlayer();
2023-10-03 12:43:54 -04:00
void Init();
void Feed(const netprot::Output out);
2023-11-19 16:46:13 -05:00
void Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime);
2023-11-13 16:02:13 -05:00
bool LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError);
2023-11-19 16:46:13 -05:00
void SetPosition(Vector3f pos) { m_position = pos; }
2023-10-03 12:43:54 -04:00
private:
2023-11-24 14:22:05 -05:00
netprot::Output current, previous;
2023-10-30 15:36:43 -04:00
std::map<uint64_t, netprot::Output> m_outbuf;
2023-10-27 14:37:53 -04:00
netprot::PlayerInfo m_pinfo;
2023-10-03 12:43:54 -04:00
float m_aminacc;
Anim m_animstate;
uint64_t m_team_id;
2023-11-13 16:02:13 -05:00
Texture m_texture_front;
2023-11-18 14:16:24 -05:00
2023-11-13 16:02:13 -05:00
2023-10-03 12:43:54 -04:00
};
#endif