X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=d55ab6f0c51790cebad22bc49617b7a347f630e7;hp=b8171ed73070a8baac5573b8c0d1c561c2427ba7;hb=7e02b21428efa3ebec14a34d0c1f81e81d362bfc;hpb=a19fdf3d9f0d7ecbf6eeeec817856d85049a8336 diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index b8171ed..d55ab6f 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -187,6 +187,7 @@ public: void Draw(graphics::Viewport &); private: + void Cache() noexcept; void TickState(double dt); void TickStats(double dt); void TickBrain(double dt); @@ -222,6 +223,13 @@ private: Situation situation; Steering steering; + // cached because steering makes heavy use of this + double perception_range; + double perception_range_squared; + double perception_omni_range; + double perception_omni_range_squared; + double perception_field; + struct Attributes { glm::vec3 position; glm::vec3 normal;