X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FSteering.hpp;h=9af62b9c7573aaf78c824b8c8a0c0ec9d20a10fa;hb=HEAD;hp=470031dd170a4ec16e201068265e9ad8807a68e8;hpb=f6c8a486a771e876a16906f482017df5e4701255;p=blobs.git diff --git a/src/creature/Steering.hpp b/src/creature/Steering.hpp index 470031d..9af62b9 100644 --- a/src/creature/Steering.hpp +++ b/src/creature/Steering.hpp @@ -17,30 +17,36 @@ public: ~Steering(); public: - void MaxAcceleration(double a) noexcept { max_accel = a; } - double MaxAcceleration() const noexcept { return max_accel; } + /// 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 MaxForce(double f) noexcept { max_force = f; } + double MaxForce() const noexcept { return max_force; } void MaxSpeed(double s) noexcept { max_speed = s; } double MaxSpeed() const noexcept { return max_speed; } public: + void Off() noexcept; void Separate(double min_distance, double max_lookaround) noexcept; void DontSeparate() noexcept; + void ResumeSeparate() noexcept; void Halt() noexcept; void Pass(const glm::dvec3 &) noexcept; void GoTo(const glm::dvec3 &) noexcept; - glm::dvec3 Acceleration(const Situation::State &) const noexcept; + glm::dvec3 Force(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; + glm::dvec3 TargetVelocity(const Situation::State &, const glm::dvec3 &, double acc) const noexcept; private: const Creature &c; glm::dvec3 target; - double max_accel; + double haste; + double max_force; double max_speed; double min_dist; double max_look;