mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2026-02-04 09:29:20 +01:00
33 lines
806 B
C++
33 lines
806 B
C++
#pragma once
|
|
|
|
class Player;
|
|
|
|
class Camera
|
|
{
|
|
public:
|
|
Camera( );
|
|
Camera( const Point2f& position, float scale = 1);
|
|
~Camera() = default;
|
|
|
|
void SetPosition( const Point2f& position ) { m_Position = position; }
|
|
void SetScale( const float scale ) { m_Scale = scale; }
|
|
|
|
const Point2f& GetPosition( ) const { return m_Position; }
|
|
float GetScale( ) const { return m_Scale; }
|
|
|
|
void BeginRendering() const;
|
|
void EndRendering() const;
|
|
|
|
void SetTrackingPlayer(Player* player) { m_FollowingPlayer = player; }
|
|
|
|
Point2f TransformMouse (const Point2f& mousePos) const;
|
|
Point2f TransformWorld (const Point2f& worldPos) const;
|
|
Rectf Viewport = Rectf{ 0, 0, 846.f, 500.f };
|
|
//TODO: Remove this and make it some static
|
|
|
|
private:
|
|
Point2f m_Position;
|
|
float m_Scale;
|
|
Player* m_FollowingPlayer{ nullptr };
|
|
};
|