]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Steering.hpp
avoid others when steering
[blobs.git] / src / creature / Steering.hpp
index 6d5b40a2103e3d98cb8039c6010ac75e6fc85339..470031dd170a4ec16e201068265e9ad8807a68e8 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef BLOBS_CREATURE_STEERING_HPP_
 #define BLOBS_CREATURE_STEERING_HPP_
 
-#include "../graphics/glm.hpp"
+#include "Situation.hpp"
+#include "../math/glm.hpp"
 
 
 namespace blobs {
@@ -12,7 +13,7 @@ class Creature;
 class Steering {
 
 public:
-       Steering();
+       explicit Steering(const Creature &);
        ~Steering();
 
 public:
@@ -23,22 +24,31 @@ public:
        double MaxSpeed() const noexcept { return max_speed; }
 
 public:
+       void Separate(double min_distance, double max_lookaround) noexcept;
+       void DontSeparate() noexcept;
        void Halt() noexcept;
+       void Pass(const glm::dvec3 &) noexcept;
        void GoTo(const glm::dvec3 &) noexcept;
 
-       glm::dvec3 Acceleration(Creature &) const noexcept;
+       glm::dvec3 Acceleration(const Situation::State &) const noexcept;
 
 private:
        bool SumForce(glm::dvec3 &out, const glm::dvec3 &in) const noexcept;
+       glm::dvec3 TargetVelocity(const Situation::State &, const glm::dvec3 &) const noexcept;
 
 private:
-       glm::dvec3 seek_target;
+       const Creature &c;
+       glm::dvec3 target;
 
-       double max_accel = 1.0;
-       double max_speed = 1.0;
+       double max_accel;
+       double max_speed;
+       double min_dist;
+       double max_look;
 
+       bool separating;
        bool halting;
        bool seeking;
+       bool arriving;
 
 };