added 4 camera positions - can switch between them with 1,2,3,4 keyboard input

This commit is contained in:
Caenneth 2024-06-22 10:19:56 +02:00
parent 20fcc2af63
commit f83c533f6f
1 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,18 @@ SceneNode* rootNode;
* Input handler for camera movement. * Input handler for camera movement.
* */ * */
void handleInputs(double deltaTime) { void handleInputs(double deltaTime) {
if (glfwGetKey(window, GLFW_KEY_1) == GLFW_PRESS) {
cameraPosition = (vec3){0.0f, 1.7f, 2.4f};
}
if (glfwGetKey(window, GLFW_KEY_2) == GLFW_PRESS) {
cameraPosition = (vec3){3.3f, 3.4f, -11.0f};
}
if (glfwGetKey(window, GLFW_KEY_3) == GLFW_PRESS) {
cameraPosition = (vec3){-3.0f, 2.9f, -7.5f};
}
if (glfwGetKey(window, GLFW_KEY_4) == GLFW_PRESS) {
cameraPosition = (vec3){-0.6f, 2.1f, -4.5f};
}
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) { if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) {
cameraPosition.z += deltaTime * 10; cameraPosition.z += deltaTime * 10;
} }