Add map pan

This commit is contained in:
Jan Mrna
2025-10-05 12:11:06 +02:00
committed by Mrna
parent 75eeac06df
commit f458468644
11 changed files with 219 additions and 33 deletions

View File

@@ -5,12 +5,16 @@
class Camera
{
public:
WindowPos WorldToWindow(WorldPos) const;
WorldPos WindowToWorld(WindowPos) const;
void Pan(const WorldPos& delta);
void Zoom(const WorldPos& delta);
WindowPos WorldToWindow(WorldPos) const;
WorldPos WindowToWorld(WindowPos) const;
WindowSize WorldToWindowSize(WorldSize) const;
WorldSize WindowToWorldSize(WindowSize) const;
private:
// TODO this should be replaced with a matrix
float m_Zoom;
WorldPos m_RectCorner; // upper left corner (0,0) of the drawn regios
WorldPos m_Pan;
};