summaryrefslogtreecommitdiff
path: root/game/terrain.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-03 00:08:47 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-03 00:08:47 +0000
commit94311f9c4e82b7475802b1934cc0c5b243e0cd2f (patch)
tree5ef23f6c1151917eb723b67c262da0168e42343c /game/terrain.cpp
parentOur own matrix rotations (diff)
downloadilt-94311f9c4e82b7475802b1934cc0c5b243e0cd2f.tar.bz2
ilt-94311f9c4e82b7475802b1934cc0c5b243e0cd2f.tar.xz
ilt-94311f9c4e82b7475802b1934cc0c5b243e0cd2f.zip
Replace Transform with Location
Simpler, unbinds the transformation matrices for location, now done just in the shader.
Diffstat (limited to 'game/terrain.cpp')
-rw-r--r--game/terrain.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/game/terrain.cpp b/game/terrain.cpp
index 44fd41d..bf16439 100644
--- a/game/terrain.cpp
+++ b/game/terrain.cpp
@@ -3,11 +3,11 @@
#include <cache.h>
#include <cmath>
#include <gfx/gl/shader.h>
-#include <gfx/gl/transform.h>
#include <gfx/image.h>
#include <gfx/models/mesh.h>
#include <gfx/models/vertex.hpp>
#include <glm/glm.hpp>
+#include <location.hpp>
#include <random>
#include <stb_image.h>
@@ -121,9 +121,6 @@ Terrain::finish(unsigned int width, unsigned int height, std::vector<Vertex> & v
meshes.create<Mesh>(vertices, indices);
}
-static const Transform identity {};
-static const auto identityModel {identity.GetModel()};
-
void
Terrain::tick(TickDuration dur)
{
@@ -133,11 +130,11 @@ Terrain::tick(TickDuration dur)
void
Terrain::render(const Shader & shader) const
{
- shader.setModel(identityModel, Shader::Program::LandMass);
+ shader.setModel(Location {}, Shader::Program::LandMass);
grass->Bind();
meshes.apply(&Mesh::Draw);
- shader.setModel(identityModel, Shader::Program::Water);
+ shader.setModel(Location {}, Shader::Program::Water);
shader.setUniform("waves", {waveCycle, 0, 0});
water->Bind();
meshes.apply(&Mesh::Draw);