]> git.localhorst.tv Git - blank.git/blobdiff - src/ai/AIController.hpp
make AI entities avoid world collisions
[blank.git] / src / ai / AIController.hpp
index cda3e8a08086465f694b020f6615c4c58ebd1271..5cbfd0ebc88455a43c434619ac3bd1c52473d0d4 100644 (file)
@@ -2,6 +2,7 @@
 #define BLANK_AI_AICONTROLLER_HPP_
 
 #include "../app/IntervalTimer.hpp"
+#include "../model/geometry.hpp"
 #include "../world/EntityController.hpp"
 
 #include <glm/glm.hpp>
@@ -54,6 +55,11 @@ public:
        void SetHaltSpeed(float) noexcept;
        glm::vec3 GetHaltForce(const Entity &, const EntityState &) const noexcept;
 
+       void StartAvoidingObstacles() noexcept;
+       void StopAvoidingObstacles() noexcept;
+       bool IsAvoidingObstacles() const noexcept;
+       glm::vec3 GetObstacleAvoidanceForce(const Entity &, const EntityState &) const noexcept;
+
        void StartFleeing() noexcept;
        void StopFleeing() noexcept;
        bool IsFleeing() const noexcept;
@@ -122,6 +128,10 @@ private:
        bool halted;
        float halt_speed;
 
+       bool avoid_obstacles;
+       AABB obstacle_box;
+       glm::mat4 obstacle_transform;
+
        bool fleeing;
        Entity *flee_target;
        float flee_speed;