]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Steering.hpp
some tweaks
[blobs.git] / src / creature / Steering.hpp
index cca757ee0b72763ec8b4f6558b8259d45ceedca2..d8f2cebfb7ba91fe1e35d736ea1261746d76448d 100644 (file)
@@ -8,13 +8,19 @@
 namespace blobs {
 namespace creature {
 
+class Creature;
+
 class Steering {
 
 public:
-       Steering();
+       explicit Steering(const Creature &);
        ~Steering();
 
 public:
+       /// factor in [0,1] of how fast you need to get there
+       void Haste(double h) noexcept { haste = h; }
+       double Haste() const noexcept { return haste; }
+
        void MaxAcceleration(double a) noexcept { max_accel = a; }
        double MaxAcceleration() const noexcept { return max_accel; }
 
@@ -22,6 +28,8 @@ 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;
@@ -29,15 +37,20 @@ public:
        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;
+       bool SumForce(glm::dvec3 &out, const glm::dvec3 &in, double max) const noexcept;
+       glm::dvec3 TargetVelocity(const Situation::State &, const glm::dvec3 &, double acc) const noexcept;
 
 private:
+       const Creature &c;
        glm::dvec3 target;
 
-       double max_accel = 1.0;
-       double max_speed = 1.0;
+       double haste;
+       double max_accel;
+       double max_speed;
+       double min_dist;
+       double max_look;
 
+       bool separating;
        bool halting;
        bool seeking;
        bool arriving;