From 3d7d036ea5aa4bbcac8174bdd796a90f863215c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 21 Jan 2016 06:11:41 -0500 Subject: [PATCH] lib/gamnit: intro `EulerCamera::center` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/cameras.nit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gamnit/cameras.nit b/lib/gamnit/cameras.nit index a238d5f..0d64395 100644 --- a/lib/gamnit/cameras.nit +++ b/lib/gamnit/cameras.nit @@ -208,6 +208,9 @@ class UICamera return new Point[Float](wx, wy) end + # Center of the screen, from the point of view of the camera, at z = 0 + fun center: Point3d[Float] do return new Point3d[Float](position.x + width / 2.0, position.y + height / 2.0, 0.0) + # Anchor in the top left corner of the screen, at z = 0 fun top_left: Point3d[Float] do return new Point3d[Float](position.x, position.y, 0.0) -- 1.7.9.5