world shifting almost working

This commit is contained in:
Piotrek
2021-05-13 16:18:01 +02:00
parent 98736c39a0
commit 120049d9f7
5 changed files with 54 additions and 26 deletions
+2 -2
View File
@@ -23,10 +23,10 @@ impl UniformValues {
Self { sun_dir, .. Default::default() }
}
pub fn update(&mut self, camera: &Camera, time: f32) {
pub fn update(&mut self, camera: &Camera, offset: Vector3<f32>, time: f32) {
self.view_inv = camera.get_view().invert().unwrap().into();
self.proj_inv = camera.get_projection().invert().unwrap().into();
self.cam_pos = camera.get_position().into();
self.cam_pos = (camera.get_position() + offset).into();
self.time = time;
}
}