/// Processes input received from a mouse input system. Expects the offset value in both the x and y direction.
Processes input received from a mouse input system. Expects the offset value in both the x and y direction.
Processes input received from a mouse input system . Expects the offset value in both the x and y direction .
pub fn process_mouse_movement(&mut self, mut xoffset: f32, mut yoffset: f32, constrain_pitch: bool) {
        xoffset *= self.mouse_sensitivity;
        yoffset *= self.mouse_sensitivity;
        self.yaw += xoffset;
        self.pitch += yoffset;
        // Make sure that when pitch is out of bounds, screen doesn't get flipped
        if constrain_pitch {
            if self.pitch > 89.0 {
                self.pitch = 89.0;
            }
            if self.pitch < -89.0 {
                self.pitch = -89.0;
            }
        }
        // Update Front, Right and Up Vectors using the updated Eular angles
        self.update_camera_vectors();
    }
pub fn process_mouse_movement ( & mut self , mut xoffset : f32 , mut yoffset : f32 , constrain_pitch : bool ) { xoffset *= self . mouse_sensitivity ; yoffset *= self . mouse_sensitivity ; self . yaw += xoffset ; self . pitch += yoffset ; // Make sure that when pitch is out of bounds, screen doesn't get flipped if constrain_pitch { if self . pitch > 89.0 { self . pitch = 89.0 ; } if self . pitch < - 89.0 { self . pitch = - 89.0 ; } } // Update Front, Right and Up Vectors using the updated Eular angles self . update_camera_vectors ( ) ; }
Processes input received from a mouse input system.
Processes input received from a mouse input system .
&mut self
xoffset
f32
yoffset
f32
constrain_pitch
bool