diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-18 21:20:51 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-18 21:20:51 -0400 |
commit | 8045b8ba04aae39a4cf9733e72413f648b6ebe2b (patch) | |
tree | f90a9bd50a2316d5077df99c9e8584afc76ed656 /src/keyboard_movement_controller.hpp | |
download | minecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.tar.gz minecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.tar.bz2 minecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.zip |
stanford dragon rendering
Diffstat (limited to 'src/keyboard_movement_controller.hpp')
-rw-r--r-- | src/keyboard_movement_controller.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/keyboard_movement_controller.hpp b/src/keyboard_movement_controller.hpp new file mode 100644 index 0000000..b90d361 --- /dev/null +++ b/src/keyboard_movement_controller.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include "xe_game_object.hpp" +#include "xe_window.hpp" +#include <GLFW/glfw3.h> + +namespace xe { + class KeyboardMovementController { + + public: + struct KeyMappings { + int moveLeft = GLFW_KEY_A; + int moveRight = GLFW_KEY_D; + int moveForward = GLFW_KEY_W; + int moveBackward = GLFW_KEY_S; + int moveUp = GLFW_KEY_E; + int moveDown = GLFW_KEY_Q; + int lookLeft = GLFW_KEY_LEFT; + int lookRight = GLFW_KEY_RIGHT; + int lookUp = GLFW_KEY_UP; + int lookDown = GLFW_KEY_DOWN; + }; + + void moveInPlaneXZ(GLFWwindow* window, float dt, XeGameObject& gameObject); + + KeyMappings keys{}; + float moveSpeed{3.f}; + float lookSpeed{1.5f}; + + }; +}
\ No newline at end of file |