summaryrefslogtreecommitdiff
path: root/engine/include
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-03 23:53:33 +0100
committerAki <please@ignore.pl>2023-02-03 23:53:33 +0100
commit6b7d0e795bc57856a1bcaaab08229bb0869e8516 (patch)
treef22e1b1cd1499d2c4a5346be0534c305386aca58 /engine/include
parentec3ae653a0965c6c19920ed46030a0abde0fee1c (diff)
downloadkurator-6b7d0e795bc57856a1bcaaab08229bb0869e8516.zip
kurator-6b7d0e795bc57856a1bcaaab08229bb0869e8516.tar.gz
kurator-6b7d0e795bc57856a1bcaaab08229bb0869e8516.tar.bz2
Extracted from/to camera viewport transformations to camera itself
Diffstat (limited to 'engine/include')
-rw-r--r--engine/include/kurator/engine/Camera.h2
-rw-r--r--engine/include/kurator/engine/Point.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/engine/include/kurator/engine/Camera.h b/engine/include/kurator/engine/Camera.h
index abe0ffe..2eb192a 100644
--- a/engine/include/kurator/engine/Camera.h
+++ b/engine/include/kurator/engine/Camera.h
@@ -13,6 +13,8 @@ struct Camera
{
Point offset = {};
double scale = 1.0;
+ Point to_world(const Point& screen) const;
+ Point to_screen(const Point& world) const;
};
diff --git a/engine/include/kurator/engine/Point.h b/engine/include/kurator/engine/Point.h
index 0e9f0ab..3dc0c8b 100644
--- a/engine/include/kurator/engine/Point.h
+++ b/engine/include/kurator/engine/Point.h
@@ -19,6 +19,8 @@ struct Point
Point normalized() const;
Point operator-(const Point& other) const;
Point operator+(const Point& other) const;
+ Point subtract(const Point& other) const;
+ Point subtract(double _x, double _y) const;
};