Skip to content

Commit

Permalink
fix(engine): fix free camera controller angle not being bounded
Browse files Browse the repository at this point in the history
  • Loading branch information
diogomsmiranda committed Feb 27, 2024
1 parent bc3df3b commit 610540f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/src/utils/free_camera/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void cubos::engine::freeCameraPlugin(Cubos& cubos)
// Update camera angles based on mouse motion.
controller.phi -= static_cast<float>(input.mouseDelta().y) * deltaTime.value * controller.sens;
controller.theta -= static_cast<float>(input.mouseDelta().x) * deltaTime.value * controller.sens;
controller.phi = std::clamp(controller.phi, -90.0F, 90.0F);
controller.phi = std::clamp(controller.phi, -89.8F, 89.8F);

Check warning on line 33 in engine/src/utils/free_camera/plugin.cpp

View check run for this annotation

Codecov / codecov/patch

engine/src/utils/free_camera/plugin.cpp#L33

Added line #L33 was not covered by tests

// Calculate camera direction from angles and calculate the rotation from it.
glm::vec3 forward{};
Expand Down

0 comments on commit 610540f

Please sign in to comment.