nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0031cd0
)
lib/gamnit: intro `EulerCamera::center`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 21 Jan 2016 11:11:41 +0000
(06:11 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 25 Jan 2016 16:54:33 +0000
(11:54 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/cameras.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/cameras.nit
b/lib/gamnit/cameras.nit
index
a238d5f
..
0d64395
100644
(file)
--- 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)