#define BLOBS_WORLD_BODY_HPP_
#include "Orbit.hpp"
-#include "../graphics/glm.hpp"
+#include "../math/glm.hpp"
#include <vector>
namespace app {
class Assets;
}
+namespace creature {
+ class Creature;
+}
namespace graphics {
class Viewport;
}
double OrbitalPeriod() const noexcept;
double RotationalPeriod() const noexcept;
- glm::dmat4 LocalTransform() const noexcept;
- glm::dmat4 InverseTransform() const noexcept;
+ const glm::dmat4 &LocalTransform() const noexcept { return local; }
+ const glm::dmat4 &InverseTransform() const noexcept { return inverse_local; }
+
+ const glm::dmat4 &ToParent() const noexcept { return inverse_orbital; }
+ const glm::dmat4 &FromParent() const noexcept { return orbital; }
- glm::dmat4 ToParent() const noexcept;
- glm::dmat4 FromParent() const noexcept;
+ glm::dmat4 ToUniverse() const noexcept;
+ glm::dmat4 FromUniverse() const noexcept;
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; }
+
+ void Atmosphere(int a) noexcept { atmosphere = a; }
+ int Atmosphere() const noexcept { return atmosphere; }
+ bool HasAtmosphere() const noexcept { return atmosphere >= 0; }
+
private:
void AddChild(Body &);
void RemoveChild(Body &);
double rotation;
double angular;
+ glm::dmat4 orbital;
+ glm::dmat4 inverse_orbital;
+ glm::dmat4 local;
+ glm::dmat4 inverse_local;
+
+ std::vector<creature::Creature *> creatures;
+ int atmosphere;
+
};
}