Lots of changes, first working version.
[mandelwow.git] / support / camera.rs
index 10ad1f0086d17e396a3f5a6075443f80be39e2ed..9f0e3bac45ea2422d0335a545b0e8c21b158dd28 100644 (file)
@@ -31,7 +31,7 @@ impl CameraState {
         CameraState {
             aspect_ratio: 1024.0 / 768.0,
             pos: Vec3(0.0, 0.0, 0.0),
-            dir: Vec3(0.0, 0.0, 1.0),
+            dir: Vec3(0.0, 0.0, -1.0),
             .. Default::default()
         }
     }
@@ -40,6 +40,10 @@ impl CameraState {
         self.pos = pos;
     }
 
+    pub fn get_pos(&self) -> Vec3 {
+        self.pos
+    }
+
     pub fn set_dir(&mut self, dir: Vec3) {
         self.dir = dir;
     }
@@ -60,7 +64,6 @@ impl CameraState {
         ]
     }
 
-
     pub fn get_view(&self) -> [[f32; 4]; 4] {
         let f = norm(&self.dir);