X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FBody.hpp;h=5f82be232b4dc3e78029fd27338b122ab4a41421;hb=98770f59a02c76f02de0a46ed36d9cfd52f5071b;hp=1b9e2e3a2a65036b75f370aa47a58b3730374545;hpb=c5556cf5f6813887a3503433c021ccd2e7fae865;p=blobs.git diff --git a/src/world/Body.hpp b/src/world/Body.hpp index 1b9e2e3..5f82be2 100644 --- a/src/world/Body.hpp +++ b/src/world/Body.hpp @@ -70,14 +70,19 @@ public: 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; } - glm::dmat4 ToParent() const noexcept; - glm::dmat4 FromParent() const noexcept; + const glm::dmat4 &ToParent() const noexcept { return inverse_orbital; } + const glm::dmat4 &FromParent() const noexcept { return orbital; } + + glm::dmat4 ToUniverse() const noexcept; + glm::dmat4 FromUniverse() const noexcept; virtual void Draw(app::Assets &, graphics::Viewport &) { } + void Cache() noexcept; + private: void AddChild(Body &); void RemoveChild(Body &); @@ -94,6 +99,11 @@ private: double rotation; double angular; + glm::dmat4 orbital; + glm::dmat4 inverse_orbital; + glm::dmat4 local; + glm::dmat4 inverse_local; + }; }