1 #ifndef BLANK_AI_AICONTROLLER_HPP_
2 #define BLANK_AI_AICONTROLLER_HPP_
4 #include "../world/EntityController.hpp"
15 : public EntityController {
18 explicit AIController(GaloisLFSR &);
21 void SetState(const AIState &);
23 void Update(Entity &, float dt) override;
25 glm::vec3 ControlForce(const Entity &, const EntityState &) const override;
27 static glm::vec3 Heading(const EntityState &) noexcept;
29 void StartFleeing(const Entity &, float speed) noexcept;
30 void StopFleeing() noexcept;
31 bool IsFleeing() const noexcept;
32 const Entity &GetFleeTarget() const noexcept;
34 void StartSeeking(const Entity &, float speed) noexcept;
35 void StopSeeking() noexcept;
36 bool IsSeeking() const noexcept;
37 const Entity &GetSeekTarget() const noexcept;
39 /// start wandering randomly at given speed
40 /// the trajectory is modified by targetting a blip on a sphere
41 /// in front of the entity which moves randomly
42 /// the displacement is given (roughly) in units per second
45 float distance = 2.0f,
47 float displacement = 1.0f
49 void StopWandering() noexcept;
55 const Entity *flee_target;
58 const Entity *seek_target;