diff options
Diffstat (limited to 'game/water.h')
-rw-r--r-- | game/water.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/game/water.h b/game/water.h new file mode 100644 index 0000000..ceb7bd2 --- /dev/null +++ b/game/water.h @@ -0,0 +1,34 @@ +#pragma once + +#include "chronology.h" +#include "collection.h" +#include "config/types.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}; + + struct Vertex { + GlobalPosition3D pos; + }; + +private: + void generateMeshes(); + + std::shared_ptr<GeoData> geoData; + Collection<MeshT<Vertex>, false> meshes; + std::shared_ptr<Texture> water; +}; |