summaryrefslogtreecommitdiff
path: root/game/water.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-06 00:47:37 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-06 00:47:37 +0100
commit737ce277a6e49d88a04be1e384eef09d486f513b (patch)
tree2eeb29d316567b1157d7a32753658df5c5f36741 /game/water.h
parentMerge remote-tracking branch 'origin/deform-terrain' (diff)
downloadilt-737ce277a6e49d88a04be1e384eef09d486f513b.tar.bz2
ilt-737ce277a6e49d88a04be1e384eef09d486f513b.tar.xz
ilt-737ce277a6e49d88a04be1e384eef09d486f513b.zip
Split water from terrain
Shares the geo data instance, and still has the same implementation at this stage.
Diffstat (limited to 'game/water.h')
-rw-r--r--game/water.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/game/water.h b/game/water.h
new file mode 100644
index 0000000..20796d7
--- /dev/null
+++ b/game/water.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "chronology.h"
+#include "collection.h"
+#include "game/worldobject.h"
+#include <gfx/models/mesh.h>
+#include <gfx/renderable.h>
+#include <memory>
+
+class SceneShader;
+class Texture;
+class GeoData;
+
+class Water : public WorldObject, public Renderable {
+public:
+ explicit Water(std::shared_ptr<GeoData>);
+
+ void render(const SceneShader & shader) const override;
+
+ void tick(TickDuration) override;
+ float waveCycle {0.F};
+
+private:
+ void generateMeshes();
+
+ std::shared_ptr<GeoData> geoData;
+ Collection<Mesh, false> meshes;
+ std::shared_ptr<Texture> water;
+};