X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fai%2FAIController.hpp;fp=src%2Fai%2FAIController.hpp;h=8e5073364ac22f9f2da21841cccadc0937b002a5;hb=0ab149c70b3f984b2cc0c7a122b4aa347bc5fd79;hp=0eca2b78335b3bbf9094bd3cd03024de8cc7ff65;hpb=d122d3e445d64f7d710c1cfaf285ff01bbe955b9;p=blank.git diff --git a/src/ai/AIController.hpp b/src/ai/AIController.hpp index 0eca2b7..8e50733 100644 --- a/src/ai/AIController.hpp +++ b/src/ai/AIController.hpp @@ -22,7 +22,7 @@ public: void Update(Entity &, float dt) override; - glm::vec3 ControlForce(const EntityState &) const override; + glm::vec3 ControlForce(const Entity &, const EntityState &) const override; static glm::vec3 Heading(const EntityState &) noexcept; @@ -36,7 +36,16 @@ public: bool IsSeeking() const noexcept; const Entity &GetSeekTarget() const noexcept; - void StartWandering() noexcept; + /// start wandering randomly at given speed + /// the trajectory is modified by targetting a blip on a sphere + /// in front of the entity which moves randomly + /// the displacement is given (roughly) in units per second + void StartWandering( + float speed, + float distance = 2.0f, + float radius = 1.0f, + float displacement = 1.0f + ) noexcept; void StopWandering() noexcept; private: @@ -51,10 +60,10 @@ private: bool wandering; glm::vec3 wander_pos; + float wander_speed; float wander_dist; float wander_radius; float wander_disp; - float wander_speed; };