]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/Body.hpp
standardized logging
[blobs.git] / src / world / Body.hpp
index fba121b90995d113c2fad374c39db8bd7ae28942..165d8483f5cbc6d890b7280ec91d6ed85401e6b1 100644 (file)
@@ -2,7 +2,7 @@
 #define BLOBS_WORLD_BODY_HPP_
 
 #include "Orbit.hpp"
-#include "../graphics/glm.hpp"
+#include "../math/glm.hpp"
 
 #include <vector>
 
@@ -11,12 +11,14 @@ namespace blobs {
 namespace app {
        class Assets;
 }
+namespace creature {
+       class Creature;
+}
 namespace graphics {
        class Viewport;
 }
 namespace world {
 
-class Creature;
 class Simulation;
 
 class Body {
@@ -33,6 +35,7 @@ public:
 
 public:
        bool HasSimulation() const noexcept { return sim; }
+       Simulation &GetSimulation() noexcept { return *sim; }
        const Simulation &GetSimulation() const noexcept { return *sim; }
        void SetSimulation(Simulation &) noexcept;
 
@@ -82,12 +85,18 @@ public:
 
        virtual void Draw(app::Assets &, graphics::Viewport &) { }
 
+       void Tick(double dt);
        void Cache() noexcept;
+       void CheckCollision() noexcept;
+
+       void AddCreature(creature::Creature *);
+       void RemoveCreature(creature::Creature *);
+       std::vector<creature::Creature *> &Creatures() noexcept { return creatures; }
+       const std::vector<creature::Creature *> &Creatures() const noexcept { return creatures; }
 
-       // body takes over ownership of given pointer
-       void AddCreature(Creature *);
-       std::vector<Creature *> &Creatures() noexcept { return creatures; }
-       const std::vector<Creature *> &Creatures() const noexcept { return creatures; }
+       void Atmosphere(int a) noexcept { atmosphere = a; }
+       int Atmosphere() const noexcept { return atmosphere; }
+       bool HasAtmosphere() const noexcept { return atmosphere >= 0; }
 
 private:
        void AddChild(Body &);
@@ -110,7 +119,8 @@ private:
        glm::dmat4 local;
        glm::dmat4 inverse_local;
 
-       std::vector<Creature *> creatures;
+       std::vector<creature::Creature *> creatures;
+       int atmosphere;
 
 };