Skip to content

Commit

Permalink
Merge pull request JoeyDeVries#245 from cyaneko/patch-1
Browse files Browse the repository at this point in the history
Fix a minor bug in rear view mirror
  • Loading branch information
JoeyDeVries authored Aug 20, 2021
2 parents e48244d + b7a196b commit 48010de
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,9 @@ int main()
shader.use();
glm::mat4 model = glm::mat4(1.0f);
camera.Yaw += 180.0f; // rotate the camera's yaw 180 degrees around
camera.Pitch += 180.0f; // rotate the camera's pitch 180 degrees around
camera.ProcessMouseMovement(0, 0, false); // call this to make sure it updates its camera vectors, note that we disable pitch constrains for this specific case (otherwise we can't reverse camera's pitch values)
glm::mat4 view = camera.GetViewMatrix();
camera.Yaw -= 180.0f; // reset it back to its original orientation
camera.Pitch -= 180.0f;
camera.ProcessMouseMovement(0, 0, true);
glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f);
shader.setMat4("view", view);
Expand Down

0 comments on commit 48010de

Please sign in to comment.