]> git.localhorst.tv Git - blank.git/blobdiff - src/controller.hpp
random walk test controller
[blank.git] / src / controller.hpp
index 63c102f489445a26bf241309ba0153b15de4c7d8..7dd3d110181120b4f60ab5e4015d243dbc8a186a 100644 (file)
@@ -4,7 +4,6 @@
 #include "entity.hpp"
 #include "geometry.hpp"
 
-#include <SDL.h>
 #include <glm/glm.hpp>
 
 
@@ -15,7 +14,10 @@ class FPSController {
 public:
        explicit FPSController(Entity &);
 
-       Ray Aim() const { return entity.Aim(); }
+       Ray Aim() const { return entity.Aim(entity.ChunkCoords()); }
+
+       const glm::vec3 &Velocity() const { return velocity; }
+       void Velocity(const glm::vec3 &vel) { velocity = vel; }
 
        // all angles in radians (full circle = 2π)
        float Pitch() const { return pitch; }
@@ -25,22 +27,30 @@ public:
        void Yaw(float y);
        void RotateYaw(float delta);
 
-       void HandleKeyboard(const SDL_KeyboardEvent &);
-       void HandleMouse(const SDL_MouseMotionEvent &);
-
        void Update(int dt);
 
 private:
        Entity &entity;
 
+       glm::vec3 velocity;
+
        float pitch;
        float yaw;
 
-       float move_velocity;
-       float pitch_sensitivity;
-       float yaw_sensitivity;
+};
+
+
+class RandomWalk {
+
+public:
+       explicit RandomWalk(Entity &);
+
+       void Update(int dt);
+
+private:
+       Entity &entity;
 
-       bool front, back, left, right, up, down;
+       int time_left;
 
 };