X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=2a40d510407e4ff791a3e16c3d9b718066ca2d93;hp=ce56dfbd56b072bd0bff1c62a1efebf09f423c7f;hb=8f6530c75730f901efd6708e4fde7e68a178adf1;hpb=c51b3bbef5c9b8ab52f55d46f08c5992fe574f70 diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index ce56dfb..2a40d51 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -1,12 +1,13 @@ #ifndef BLOBS_CREATURE_CREATURE_HPP_ #define BLOBS_CREATURE_CREATURE_HPP_ +#include "Genome.hpp" #include "Goal.hpp" #include "Need.hpp" #include "Situation.hpp" #include "Steering.hpp" -#include "../graphics/glm.hpp" #include "../graphics/SimpleVAO.hpp" +#include "../math/glm.hpp" #include #include @@ -46,6 +47,12 @@ public: void Name(const std::string &n) noexcept { name = n; } const std::string &Name() const noexcept { return name; } + Genome &GetGenome() noexcept { return genome; } + const Genome &GetGenome() const noexcept { return genome; } + + void Mass(double m) noexcept { mass = m; } + double Mass() const noexcept { return mass; } + void Size(double s) noexcept { size = s; } double Size() const noexcept { return size; } @@ -69,7 +76,7 @@ public: void Velocity(const glm::dvec3 &v) noexcept { vel = v; } const glm::dvec3 &Velocity() const noexcept { return vel; } - bool Moving() const noexcept { return !allzero(vel); } + bool Moving() const noexcept { return glm::length2(vel) < 0.000001; } glm::dmat4 LocalTransform() noexcept; @@ -79,6 +86,10 @@ public: private: world::Simulation ∼ std::string name; + + Genome genome; + + double mass; double size; double health;