]> git.localhorst.tv Git - blobs.git/blob - src/creature/Steering.hpp
randomize creature properties a bit
[blobs.git] / src / creature / Steering.hpp
1 #ifndef BLOBS_CREATURE_STEERING_HPP_
2 #define BLOBS_CREATURE_STEERING_HPP_
3
4 #include "../math/glm.hpp"
5
6
7 namespace blobs {
8 namespace creature {
9
10 class Creature;
11
12 class Steering {
13
14 public:
15         Steering();
16         ~Steering();
17
18 public:
19         void MaxAcceleration(double a) noexcept { max_accel = a; }
20         double MaxAcceleration() const noexcept { return max_accel; }
21
22         void MaxSpeed(double s) noexcept { max_speed = s; }
23         double MaxSpeed() const noexcept { return max_speed; }
24
25 public:
26         void Halt() noexcept;
27         void GoTo(const glm::dvec3 &) noexcept;
28
29         glm::dvec3 Acceleration(Creature &) const noexcept;
30
31 private:
32         bool SumForce(glm::dvec3 &out, const glm::dvec3 &in) const noexcept;
33
34 private:
35         glm::dvec3 seek_target;
36
37         double max_accel = 1.0;
38         double max_speed = 1.0;
39
40         bool halting;
41         bool seeking;
42
43 };
44
45 }
46 }
47
48 #endif