From 6b7d0e795bc57856a1bcaaab08229bb0869e8516 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 3 Feb 2023 23:53:33 +0100 Subject: Extracted from/to camera viewport transformations to camera itself --- engine/include/kurator/engine/Camera.h | 2 ++ engine/include/kurator/engine/Point.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'engine/include') 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; }; -- cgit v1.1