mutzing about with a fps renderer. I am satisfied with this imgui thing I have going on. But it's a bit bone headed to have these two components so tightly coupled

This commit is contained in:
2021-02-21 02:55:43 -08:00
parent e376241aae
commit 4a041cc833
5 changed files with 138 additions and 35 deletions

View File

@@ -5,7 +5,8 @@ use cgmath::{Decomposed, InnerSpace, Matrix4, Point3, Rad, Vector3};
use winit_24::dpi::{LogicalPosition, PhysicalPosition};
use winit_24::event::{ElementState, MouseScrollDelta, VirtualKeyCode};
use crate::render::OPENGL_TO_WGPU_MATRIX;
use imgui::Condition;
use imgui::*;
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Camera {
@@ -150,6 +151,7 @@ impl CameraController {
}
pub fn update_camera(&mut self, camera: &mut Camera, dt: f32) {
// Move forward/backward and left/right
let view_vector = Vector3::new(
(1.0 * camera.pitch.0.sin() * camera.yaw.0.sin()),