src/camera.c
// calculates the front vector from the Camera's (updated) Euler Angles
calculates the front vector from the Camera's (updated) Euler Angles
calculates the front vector from the Camera ' s ( updated ) Euler Angles
void updateCameraVectors(camera *camera) {
    camera->Front[0] = cosf(glm_rad(camera->Yaw)) * cosf(glm_rad(camera->Pitch));
    camera->Front[1] = sinf(glm_rad(camera->Pitch));
    camera->Front[2] = sinf(glm_rad(camera->Yaw)) * cosf(glm_rad(camera->Pitch));
    glm_vec3_norm(camera->Front);
    glm_vec3_cross(camera->Front, camera->WorldUp, camera->Right);
    glm_vec3_cross(camera->Right, camera->Front, camera->Up);
    glm_vec3_norm(camera->Up);
    _update_viewMatrix(camera);
}
void updateCameraVectors ( camera * camera ) { camera -> Front [ 0 ] = cosf ( glm_rad ( camera -> Yaw ) ) * cosf ( glm_rad ( camera -> Pitch ) ) ; camera -> Front [ 1 ] = sinf ( glm_rad ( camera -> Pitch ) ) ; camera -> Front [ 2 ] = sinf ( glm_rad ( camera -> Yaw ) ) * cosf ( glm_rad ( camera -> Pitch ) ) ; glm_vec3_norm ( camera -> Front ) ; glm_vec3_cross ( camera -> Front , camera -> WorldUp , camera -> Right ) ; glm_vec3_cross ( camera -> Right , camera -> Front , camera -> Up ) ; glm_vec3_norm ( camera -> Up ) ; _update_viewMatrix ( camera ) ; }
calculates the front vector from the Camera's (updated) Euler Angles
calculates the front vector from the Camera ' s ( updated ) Euler Angles
// calculate the new Front vector //Front = glm::normalize(front); // 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.