X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FPlanet.hpp;h=af3b512aea6b058bc97b4dadb7435b0bc65d4347;hb=bcf776b6d51aeb9147bde32da8dd0768b10db993;hp=0c468f5f0214d1c52ef2677a47d10ced809be72e;hpb=be413456f57da06e918ae7bf4c4f35e5198ff7ce;p=blobs.git diff --git a/src/world/Planet.hpp b/src/world/Planet.hpp index 0c468f5..af3b512 100644 --- a/src/world/Planet.hpp +++ b/src/world/Planet.hpp @@ -3,19 +3,20 @@ #include "Body.hpp" +#include "Set.hpp" #include "Tile.hpp" #include "../graphics/glm.hpp" #include "../graphics/SimpleVAO.hpp" #include -#include +#include #include namespace blobs { namespace world { -struct Tile; +class TileType; /// A planet has six surfaces, numbered 0 to 5, each filled with /// sidelength² tiles. @@ -61,12 +62,14 @@ public: return 6 * TilesPerSurface(); } - void BuildVAOs(); + glm::dvec3 TileCenter(int surface, int x, int y) const noexcept; + + void BuildVAO(const Set &); void Draw(app::Assets &, graphics::Viewport &) override; private: int sidelength; - std::unique_ptr tiles; + std::vector tiles; struct Attributes { glm::vec3 position; @@ -76,7 +79,8 @@ private: }; -void GenerateTest(Planet &); +void GenerateEarthlike(const Set &, Planet &) noexcept; +void GenerateTest(const Set &, Planet &) noexcept; } }