]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/Planet.hpp
basic creature model
[blobs.git] / src / world / Planet.hpp
index 0c468f5f0214d1c52ef2677a47d10ced809be72e..900ebbbe8ae4fb6412e337e43566fc7899df1da8 100644 (file)
@@ -8,14 +8,14 @@
 #include "../graphics/SimpleVAO.hpp"
 
 #include <cassert>
-#include <memory>
+#include <vector>
 #include <GL/glew.h>
 
 
 namespace blobs {
 namespace world {
 
-struct Tile;
+class TileSet;
 
 /// A planet has six surfaces, numbered 0 to 5, each filled with
 /// sidelength² tiles.
@@ -61,12 +61,14 @@ public:
                return 6 * TilesPerSurface();
        }
 
-       void BuildVAOs();
+       glm::dvec3 TileCenter(int surface, int x, int y) const noexcept;
+
+       void BuildVAO(const TileSet &);
        void Draw(app::Assets &, graphics::Viewport &) override;
 
 private:
        int sidelength;
-       std::unique_ptr<Tile []> tiles;
+       std::vector<Tile> tiles;
 
        struct Attributes {
                glm::vec3 position;
@@ -76,7 +78,8 @@ private:
 
 };
 
-void GenerateTest(Planet &);
+void GenerateEarthlike(const TileSet &, Planet &) noexcept;
+void GenerateTest(const TileSet &, Planet &) noexcept;
 
 }
 }