2023-06-10 14:48:16 +02:00
|
|
|
#ifndef HOLESOME_MAP_PLAYER_HPP
|
|
|
|
#define HOLESOME_MAP_PLAYER_HPP
|
|
|
|
|
|
|
|
|
|
|
|
#include <box2d/box2d.h>
|
|
|
|
#include "../player/player.hpp"
|
2023-06-10 15:24:03 +02:00
|
|
|
#include "../../config.h"
|
2023-06-10 14:48:16 +02:00
|
|
|
|
2023-06-11 15:18:22 +02:00
|
|
|
class MapPlayer
|
2023-06-10 14:48:16 +02:00
|
|
|
{
|
2023-06-11 15:18:22 +02:00
|
|
|
public:
|
2023-06-10 14:48:16 +02:00
|
|
|
Player *player;
|
|
|
|
b2Body *body;
|
2023-06-11 15:18:22 +02:00
|
|
|
float shapeRadius = 0;
|
2023-06-10 14:48:16 +02:00
|
|
|
|
2023-06-10 15:24:03 +02:00
|
|
|
MapPlayer(Player *player, b2Body *body) : player(player), body(body)
|
|
|
|
{
|
2023-06-11 15:18:22 +02:00
|
|
|
updateShape();
|
|
|
|
}
|
2023-06-10 15:24:03 +02:00
|
|
|
|
2023-06-11 15:18:22 +02:00
|
|
|
void updateSimulationPosition();
|
2023-06-10 15:24:03 +02:00
|
|
|
|
2023-06-11 15:18:22 +02:00
|
|
|
void updatePlayerPosition() const;
|
2023-06-10 15:24:03 +02:00
|
|
|
|
2023-06-11 15:18:22 +02:00
|
|
|
void updateShape();
|
2023-06-10 14:48:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //HOLESOME_MAP_PLAYER_HPP
|