pub fn update(&mut self, state: &EngineStateRef, dt: f32) {
        // move the camera with wasd
        let camera_speed = self.movement_speed * dt;
        if state.inputs.is_key_pressed(Scancode::W) {
            self.pos += camera_speed * self.front;
        }
        if state.inputs.is_key_pressed(Scancode::S) {
            self.pos -= camera_speed * self.front;
        }
        if state.inputs.is_key_pressed(Scancode::A) {
            self.pos -= camera_speed * self.right;
        }
        if state.inputs.is_key_pressed(Scancode::D) {
            self.pos += camera_speed * self.right;
        }
        if state.inputs.is_key_pressed(Scancode::Space) {
            self.pos += camera_speed * self.world_up;
        }
        if state.inputs.is_key_pressed(Scancode::LeftShift) {
            self.pos -= camera_speed * self.world_up;
        }
        /*
                // move the camera based upon mouse movement
                let (x, y) = state.inputs.mouse_delta();
                let x_offset = x as f32 * self.mouse_sensitivity;
                let y_offset = y as f32 * self.mouse_sensitivity;

                self.yaw += x_offset;
                self.pitch += y_offset;
        */
        if self.pitch > 89.0 {
            self.pitch = 89.0
        }
        if self.pitch < -89.0 {
            self.pitch = -89.0
        }

        // change the zoom level depending upon scroll wheel
        self.zoom += self.zoom_speed * state.inputs.wheel_delta().1 as f32;
        if self.zoom < 1.0 {
            self.zoom = 1.0;
        }
        if self.zoom > 15.0 {
            self.zoom = 15.0;
        }

        self.update_vectors();
    }
/// update the camera's location from user input
update the camera's location from user input
update the camera ' s location from user input
pub fn update(&mut self, state: &EngineStateRef, dt: f32) {
        // move the camera with wasd
        let camera_speed = self.movement_speed * dt;
        if state.inputs.is_key_pressed(Scancode::W) {
            self.pos += camera_speed * self.front;
        }
        if state.inputs.is_key_pressed(Scancode::S) {
            self.pos -= camera_speed * self.front;
        }
        if state.inputs.is_key_pressed(Scancode::A) {
            self.pos -= camera_speed * self.right;
        }
        if state.inputs.is_key_pressed(Scancode::D) {
            self.pos += camera_speed * self.right;
        }
        if state.inputs.is_key_pressed(Scancode::Space) {
            self.pos += camera_speed * self.world_up;
        }
        if state.inputs.is_key_pressed(Scancode::LeftShift) {
            self.pos -= camera_speed * self.world_up;
        }
        /*
                // move the camera based upon mouse movement
                let (x, y) = state.inputs.mouse_delta();
                let x_offset = x as f32 * self.mouse_sensitivity;
                let y_offset = y as f32 * self.mouse_sensitivity;
                self.yaw += x_offset;
                self.pitch += y_offset;
        */
        if self.pitch > 89.0 {
            self.pitch = 89.0
        }
        if self.pitch < -89.0 {
            self.pitch = -89.0
        }
        // change the zoom level depending upon scroll wheel
        self.zoom += self.zoom_speed * state.inputs.wheel_delta().1 as f32;
        if self.zoom < 1.0 {
            self.zoom = 1.0;
        }
        if self.zoom > 15.0 {
            self.zoom = 15.0;
        }
        self.update_vectors();
    }
pub fn update ( & mut self , state : & EngineStateRef , dt : f32 ) { // move the camera with wasd let camera_speed = self . movement_speed * dt ; if state . inputs . is_key_pressed ( Scancode :: W ) { self . pos += camera_speed * self . front ; } if state . inputs . is_key_pressed ( Scancode :: S ) { self . pos -= camera_speed * self . front ; } if state . inputs . is_key_pressed ( Scancode :: A ) { self . pos -= camera_speed * self . right ; } if state . inputs . is_key_pressed ( Scancode :: D ) { self . pos += camera_speed * self . right ; } if state . inputs . is_key_pressed ( Scancode :: Space ) { self . pos += camera_speed * self . world_up ; } if state . inputs . is_key_pressed ( Scancode :: LeftShift ) { self . pos -= camera_speed * self . world_up ; } /*
                // move the camera based upon mouse movement
                let (x, y) = state.inputs.mouse_delta();
                let x_offset = x as f32 * self.mouse_sensitivity;
                let y_offset = y as f32 * self.mouse_sensitivity;

                self.yaw += x_offset;
                self.pitch += y_offset;
        */ if self . pitch > 89.0 { self . pitch = 89.0 } if self . pitch < - 89.0 { self . pitch = - 89.0 } // change the zoom level depending upon scroll wheel self . zoom += self . zoom_speed * state . inputs . wheel_delta ( ) . 1 as f32 ; if self . zoom < 1.0 { self . zoom = 1.0 ; } if self . zoom > 15.0 { self . zoom = 15.0 ; } self . update_vectors ( ) ; }
update the camera's location from user input
update the camera ' s location from user input
&mut self
state
&EngineStateRef
dt
f32
&mut self
state
&EngineStateRef
dt
f32