mouselook

This commit is contained in:
2016-12-26 12:46:59 -08:00
committed by Jared Burce
parent f40786931e
commit 5e18d452cb
3 changed files with 17 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ impl ViewRoot<gfx_device_gl::Device, ColorFormat, DepthFormat> {
1.0).to_homogeneous();
let proj_mat = na::geometry::Perspective3::new(1.0, 90.0, NEAR, FAR);
let scene_mat = scene.origin();
let viewmodel_mat = head_mat * scene_mat;
let viewmodel_mat = scene.mouselook() * head_mat * scene_mat;
let trans = Trans { viewmodel: *viewmodel_mat.as_ref(),
matrix: *(proj_mat.as_matrix() * viewmodel_mat).as_ref() };
window.encoder.update_constant_buffer(&self.trans, &trans);