X-Git-Url: https://codewiz.org/gitweb?p=mandelwow.git;a=blobdiff_plain;f=support%2Fcamera.rs;fp=support%2Fcamera.rs;h=9f0e3bac45ea2422d0335a545b0e8c21b158dd28;hp=10ad1f0086d17e396a3f5a6075443f80be39e2ed;hb=4dc39ef481d889a00657ef9b22760cd2b0095e86;hpb=b1f47d18bd76c1d1475f992f021e714289f4b79a diff --git a/support/camera.rs b/support/camera.rs index 10ad1f0..9f0e3ba 100644 --- a/support/camera.rs +++ b/support/camera.rs @@ -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);