/// Calculates the front vector from the Camera's (updated) Eular Angles
Calculates the front vector from the Camera's (updated) Eular Angles
Calculates the front vector from the Camera ' s ( updated ) Eular Angles
fn update_camera_vectors(&mut self) {
        // Calculate the new Front vector
        let front = Vector3 {
            x: self.yaw.to_radians().cos() * self.pitch.to_radians().cos(),
            y: self.pitch.to_radians().sin(),
            z: self.yaw.to_radians().sin() * self.pitch.to_radians().cos(),
        };
        self.front = front.normalize();
        // Also re-calculate the Right and Up vector
        self.right = self.front.cross(self.world_up).normalize(); // Normalize the vectors, because their length gets closer to 0 the more you look up or down which results in slower movement.
        self.up = self.right.cross(self.front).normalize();
    }
fn update_camera_vectors ( & mut self ) { // Calculate the new Front vector let front = Vector3 { x : self . yaw . to_radians ( ) . cos ( ) * self . pitch . to_radians ( ) . cos ( ) , y : self . pitch . to_radians ( ) . sin ( ) , z : self . yaw . to_radians ( ) . sin ( ) * self . pitch . to_radians ( ) . cos ( ) , } ; self . front = front . normalize ( ) ; // Also re-calculate the Right and Up vector self . right = self . front . cross ( self . world_up ) . normalize ( ) ; // Normalize the vectors, because their length gets closer to 0 the more you look up or down which results in slower movement. self . up = self . right . cross ( self . front ) . normalize ( ) ; }
Calculates the front vector from the Camera's (updated) Eular Angles
Calculates the front vector from the Camera ' s ( updated ) Eular Angles
&mut self