camera.cpp
// 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
void Camera::updateCameraVectors()
{
    glm::vec3 front;
    front.x = cos(glm::radians(this->Yaw)) * cos(glm::radians(this->Pitch));
    front.y = sin(glm::radians(this->Pitch));
    front.z = sin(glm::radians(this->Yaw)) * cos(glm::radians(this->Pitch));
    this->Front = glm::normalize(front);
    this->Right = glm::normalize(glm::cross(this->Front,
                                            this->WorldUp));  
    this->Up = glm::normalize(glm::cross(this->Right, this->Front));
}
void Camera :: updateCameraVectors ( ) { glm :: vec3 front ; front . x = cos ( glm :: radians ( this -> Yaw ) ) * cos ( glm :: radians ( this -> Pitch ) ) ; front . y = sin ( glm :: radians ( this -> Pitch ) ) ; front . z = sin ( glm :: radians ( this -> Yaw ) ) * cos ( glm :: radians ( this -> Pitch ) ) ; this -> Front = glm :: normalize ( front ) ; this -> Right = glm :: normalize ( glm :: cross ( this -> Front , this -> WorldUp ) ) ; this -> Up = glm :: normalize ( glm :: cross ( this -> Right , this -> Front ) ) ; }
Calculates the front vector from the Camera's (updated) Eular Angles
Calculates the front vector from the Camera ' s ( updated ) Eular Angles
// Calculate the new Front vector // Also re-calculate the Right and Up vector // Normalize the vectors, because their length gets closer to 0 the more you look up or down which results in slower movement.