X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=f22f3da2e9cf461d5caabde8468046133dfcc65a;hb=cead4f0686af352cdbac1f2c2df9b6a21ad9faec;hp=28e41311c287191cd8c218e795c773926e43cb79;hpb=f764c5e628865648bb277b1081bc23d60de38d9d;p=blobs.git diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index 28e4131..f22f3da 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -121,9 +121,13 @@ public: // stats with effects applied double Strength() const noexcept; + double StrengthFactor() const noexcept; double Stamina() const noexcept; + double StaminaFactor() const noexcept; double Dexerty() const noexcept; + double DexertyFactor() const noexcept; double Intelligence() const noexcept; + double IntelligenceFactor() const noexcept; double Lifetime() const noexcept; double Fertility() const noexcept; double Mutability() const noexcept; @@ -144,7 +148,7 @@ public: void Hurt(double d) noexcept; void Die() noexcept; bool Dead() const noexcept; - void OnDeath(Callback cb) noexcept { on_death = cb; } + void WhenDead(Callback cb) noexcept { on_death = cb; } void Remove() noexcept; bool Removable() const noexcept { return removable; } void Removed() noexcept; @@ -173,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(); @@ -183,6 +189,7 @@ public: void Draw(graphics::Viewport &); private: + void Cache() noexcept; void TickState(double dt); void TickStats(double dt); void TickBrain(double dt); @@ -218,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;