diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-08 00:59:52 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-08 00:59:52 +0100 |
commit | 34ea78ea50b015d660fbd9169f61506363959214 (patch) | |
tree | 1cb1de6865c0c35e2c35fcd6e2b5610b0eedd8ab /game/water.h | |
parent | Merge remote-tracking branch 'origin/deform-terrain' (diff) | |
parent | Fix water texture wrapper in light of large position values (diff) | |
download | ilt-34ea78ea50b015d660fbd9169f61506363959214.tar.bz2 ilt-34ea78ea50b015d660fbd9169f61506363959214.tar.xz ilt-34ea78ea50b015d660fbd9169f61506363959214.zip |
Merge branch 'separate-water'
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; +}; |