]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Creature.hpp
aggression
[blobs.git] / src / creature / Creature.hpp
index 2c0b6b8dabd8198d85c6f6ef9dc9743e5710b7d4..f22f3da2e9cf461d5caabde8468046133dfcc65a 100644 (file)
@@ -177,9 +177,11 @@ public:
        Steering &GetSteering() noexcept { return steering; }
        const Steering &GetSteering() const noexcept { return steering; }
 
-       math::AABB CollisionBox() const noexcept;
+       math::AABB CollisionBounds() const noexcept;
        glm::dmat4 CollisionTransform() const noexcept;
 
+       void OnCollide(Creature &other);
+
        glm::dmat4 LocalTransform() noexcept;
 
        void BuildVAO();
@@ -187,6 +189,7 @@ public:
        void Draw(graphics::Viewport &);
 
 private:
+       void Cache() noexcept;
        void TickState(double dt);
        void TickStats(double dt);
        void TickBrain(double dt);
@@ -222,6 +225,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;