lib/gamnit: solve the mysterious bug "camera is 2 times too far"
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 23 Jan 2016 16:45:46 +0000 (11:45 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 25 Jan 2016 16:54:32 +0000 (11:54 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/cameras.nit

index df29341..a238d5f 100644 (file)
@@ -127,7 +127,7 @@ class EulerCamera
                var view = new Matrix.identity(4)
 
                # Translate the world away from the camera
-               view.translate(-position.x/2.0, -position.y/2.0, -position.z/2.0)
+               view.translate(-position.x, -position.y, -position.z)
 
                # Rotate the camera, first by looking left or right, then up or down
                view = view * rotation_matrix
@@ -227,7 +227,7 @@ class UICamera
                var view = new Matrix.identity(4)
 
                # Translate the world away from the camera
-               view.translate(-position.x/2.0, -position.y/2.0, -position.z/2.0)
+               view.translate(-position.x, -position.y, -position.z)
 
                # Use a projection matrix with a depth
                var projection = new Matrix.orthogonal(0.0, width, -height, 0.0, near, far)