holesome/src/game/physics/map/map_player.hpp

32 lines
560 B
C++
Raw Normal View History

#ifndef HOLESOME_MAP_PLAYER_HPP
#define HOLESOME_MAP_PLAYER_HPP
#include <box2d/box2d.h>
#include <utility>
2023-06-11 15:54:05 +02:00
#include "../../player/player.hpp"
#include "../../../config.h"
2023-06-11 15:18:22 +02:00
class MapPlayer
{
2023-06-11 15:18:22 +02:00
public:
std::shared_ptr<Player> player;
b2Body *body;
2023-06-11 15:18:22 +02:00
float shapeRadius = 0;
MapPlayer(std::shared_ptr<Player> player, b2Body *body) : player(std::move(player)), body(body)
{
2023-06-11 15:18:22 +02:00
updateShape();
}
2023-06-11 15:18:22 +02:00
void updateSimulationPosition();
2023-06-11 15:18:22 +02:00
void updatePlayerPosition() const;
2023-06-11 15:18:22 +02:00
void updateShape();
};
#endif //HOLESOME_MAP_PLAYER_HPP