summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 16eda51..32d3b4b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -71,7 +71,7 @@ void run() {
     auto mesh = MC::Binder::load(shape);
 
     MC::Camera camera{};
-    camera.set_position({0.0f, 0.0f, -3.0f});
+    camera.set_position({0.0f, 0.0f, 3.0f});
 
     MC::ShaderProgram program(MC::Shader::create_fragment(), MC::Shader::create_vertex());
 
@@ -124,16 +124,17 @@ void process_input(MC::Window& window, MC::Camera& camera) {
 
     auto key = [&](int key) -> float { return window.key(key, GLFW_PRESS); };
 
-    float forward = key(GLFW_KEY_W) - key(GLFW_KEY_S);
-    float side = key(GLFW_KEY_D) - key(GLFW_KEY_A);
+    float x = key(GLFW_KEY_D) - key(GLFW_KEY_A);
+    float y = key(GLFW_KEY_SPACE) - key(GLFW_KEY_LEFT_SHIFT);
+    float z = key(GLFW_KEY_S) - key(GLFW_KEY_W);
 
-    float vertical = key(GLFW_KEY_UP) - key(GLFW_KEY_DOWN);
-    float horizontal = key(GLFW_KEY_LEFT) - key(GLFW_KEY_RIGHT);
+    float rx = key(GLFW_KEY_DOWN) - key(GLFW_KEY_UP);
+    float ry = key(GLFW_KEY_RIGHT) - key(GLFW_KEY_LEFT);
 
     auto speed = 0.05f;
 
-    camera.move({side * speed, forward * speed, 0.0f});
-    camera.rotate({vertical * speed, horizontal * speed, 0.0f});
+    camera.move({x * speed, y * speed, z * speed});
+    camera.rotate({rx * speed, ry * speed, 0.0f});
 }
 
 void setup_gl() {