X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fworld%2FBody.hpp;h=d90806584b0e43d37f1202d0dcddce7e8afe3d23;hp=165d8483f5cbc6d890b7280ec91d6ed85401e6b1;hb=3989da924c4e33c52f500aead5ae62bb40294781;hpb=41ee8b5d0229752576a55e102d8510ea1dbc909b diff --git a/src/world/Body.hpp b/src/world/Body.hpp index 165d848..d908065 100644 --- a/src/world/Body.hpp +++ b/src/world/Body.hpp @@ -2,8 +2,10 @@ #define BLOBS_WORLD_BODY_HPP_ #include "Orbit.hpp" +#include "../math/geometry.hpp" #include "../math/glm.hpp" +#include #include @@ -47,6 +49,9 @@ public: const std::vector &Children() const noexcept { return children; } + const std::string &Name() const noexcept { return name; } + void Name(const std::string &n) noexcept { name = n; } + double Mass() const noexcept { return mass; } void Mass(double m) noexcept { mass = m; } @@ -73,6 +78,10 @@ public: double GravitationalParameter() const noexcept; double OrbitalPeriod() const noexcept; double RotationalPeriod() const noexcept; + double SphereOfInfluence() const noexcept; + + math::Sphere CollisionBounds() const noexcept { return math::Sphere{ glm::dvec3(0.0), Radius() }; } + const glm::dmat4 &CollisionTransform() const noexcept { return local; } const glm::dmat4 &LocalTransform() const noexcept { return local; } const glm::dmat4 &InverseTransform() const noexcept { return inverse_local; } @@ -106,6 +115,7 @@ private: Simulation *sim; Body *parent; std::vector children; + std::string name; double mass; double radius; Orbit orbit;