]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/AIController.hpp
centralize entity controllers
[blank.git] / src / ai / AIController.hpp
diff --git a/src/ai/AIController.hpp b/src/ai/AIController.hpp
new file mode 100644 (file)
index 0000000..53bdc82
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BLANK_AI_AICONTROLLER_HPP_
+#define BLANK_AI_AICONTROLLER_HPP_
+
+#include "../world/EntityController.hpp"
+
+#include <glm/glm.hpp>
+
+
+namespace blank {
+
+class GaloisLFSR;
+
+class AIController
+: public EntityController {
+
+public:
+       explicit AIController(GaloisLFSR &);
+       ~AIController();
+
+       void Update(Entity &, float dt) override;
+
+       glm::vec3 ControlForce(const EntityState &) const override;
+
+       static glm::vec3 Heading(const EntityState &) noexcept;
+
+private:
+       GaloisLFSR &random;
+
+       float chase_speed;
+       float flee_speed;
+       float stop_dist;
+       float flee_dist;
+
+       glm::vec3 wander_pos;
+       float wander_dist;
+       float wander_radius;
+       float wander_disp;
+       float wander_speed;
+
+};
+
+}
+
+#endif