From 76c465903b84a51ece00f36d5fa05618722edff7 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 29 Nov 2020 12:26:43 +0300 Subject: [PATCH] Support constructing orthographic_camera from 2d box --- libs/geom/include/psemek/geom/camera.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/geom/include/psemek/geom/camera.hpp b/libs/geom/include/psemek/geom/camera.hpp index 8651a4ec..4e2a73ef 100644 --- a/libs/geom/include/psemek/geom/camera.hpp +++ b/libs/geom/include/psemek/geom/camera.hpp @@ -59,6 +59,13 @@ namespace psemek::geom orthographic_camera() = default; + orthographic_camera(geom::box const & box) + { + this->box[0] = box[0]; + this->box[1] = box[1]; + this->box[2] = {-1.f, 1.f}; + } + orthographic_camera(geom::box const & box) : box{box} {}