Skip to content
Snippets Groups Projects
Verified Commit 0feeafb2 authored by Josch Morgenstern's avatar Josch Morgenstern
Browse files

[#60] fix initial perspective

parent 25df459d
No related branches found
No related tags found
1 merge request!65Resolve "Kamera - Steuerung mittels Controller"
Pipeline #25859 passed
......@@ -83,7 +83,7 @@ namespace vkcv::camera {
GLFWgamepadstate gamepadState;
glfwGetGamepadState(gamepadIndex, &gamepadState);
double time = glfwGetTime();
double time = glfwGetTime(); // TODO: Should time be a member variable?
if (time - m_inputDelayTimer > 0.2) {
int switchDirection = gamepadState.buttons[GLFW_GAMEPAD_BUTTON_DPAD_RIGHT] - gamepadState.buttons[GLFW_GAMEPAD_BUTTON_DPAD_LEFT];
m_activeCameraIndex += switchDirection;
......@@ -107,7 +107,7 @@ namespace vkcv::camera {
uint32_t CameraManager::addCamera(ControllerType controllerType) {
Camera camera;
camera.setPerspective(glm::radians(60.0f), m_window.getWidth() / m_window.getHeight(), 0.1f, 10.0f);
camera.setPerspective(glm::radians(60.0f), static_cast<float>(m_window.getWidth()) / static_cast<float>(m_window.getHeight()), 0.1f, 10.0f);
return addCamera(controllerType, camera);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment