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/src/Point.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'engine/src/Point.cpp') diff --git a/engine/src/Point.cpp b/engine/src/Point.cpp index b5ce4eb..f02991c 100644 --- a/engine/src/Point.cpp +++ b/engine/src/Point.cpp @@ -57,7 +57,7 @@ Point::normalized() const Point Point::operator-(const Point& other) const { - return {x - other.x, y - other.y}; + return subtract(other); } @@ -68,5 +68,19 @@ Point::operator+(const Point& other) const } +Point +Point::subtract(const Point& other) const +{ + return {x - other.x, y - other.y}; +} + + +Point +Point::subtract(const double _x, const double _y) const +{ + return {x - _x, y - _y}; +} + + } // namespace engine } // namespace kurator -- cgit v1.1