merge Develop into main after sprint 1 #1

Merged
SemvdH merged 55 commits from develop into main 2021-06-02 09:02:27 +00:00
Showing only changes of commit e46e26c729 - Show all commits

View File

@@ -28,6 +28,11 @@ void FpsCam::move(float angle, float fac)
void FpsCam::update(GLFWwindow* window) void FpsCam::update(GLFWwindow* window)
{ {
double currentTime = glfwGetTime();
static double lastFrameTime = 0;
double deltaTime = currentTime - lastFrameTime;
lastFrameTime = currentTime;
double x, y; double x, y;
glfwGetCursorPos(window, &x, &y); glfwGetCursorPos(window, &x, &y);
@@ -42,11 +47,11 @@ void FpsCam::update(GLFWwindow* window)
if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS) if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS)
move(0, 0.05f); move(0, 4.0f * deltaTime);
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS) if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS)
move(180, 0.05f); move(180, 4.0f * deltaTime);
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
move(90, 0.05f); move(90, 4.0f * deltaTime);
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)
move(-90, 0.05f); move(-90, 4.0f * deltaTime);
} }