Files
2024-04-17 13:54:48 +02:00

47 lines
1002 B
C++

#pragma once
class Player;
class Camera
{
public:
Camera();
Camera(const Vector2f& position, float scale = 1);
~Camera() = default;
Camera(const Camera& other) = default;
Camera& operator=(const Camera& other) = default;
void SetPosition(const Vector2f& position) {
m_Position = position;
}
void SetScale(const float scale) {
m_Scale = scale;
}
const Vector2f& GetPosition() const {
return m_Position;
}
float GetScale() const {
return m_Scale;
}
void BeginRendering() const;
void EndRendering() const;
void SetTrackingPlayer(Player* player) {
m_FollowingPlayer = player;
}
Vector2f TransformMouse(const Vector2f& mousePos) const;
Vector2f TransformWorld(const Vector2f& worldPos) const;
Rectf Viewport = Rectf { 0, 0, 846.f, 500.f };
//TODO: Remove this and make it some static
private:
Vector2f m_Position;
float m_Scale;
Player* m_FollowingPlayer { nullptr };
//TODO: Ask if the rule applies to the fact that the player is not managed by the camera
};