summaryrefslogtreecommitdiff
path: root/game/terrain.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:06:36 +0100
commit30b027f84772d4b1d18eebd03b83ce3a5966d5fe (patch)
treebf1f424ee3c92516d652934cf502ee06f60c57e5 /game/terrain.cpp
parentSimplify vector addition/subtraction with differnt types (diff)
parentRemove wireframe mode from test renders (diff)
downloadilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.bz2
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.xz
ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.zip
Merge remote-tracking branch 'origin/deform-terrain'
Two related issues remain: * Terrain self shadowing is common and handled poorly * Odd, but mathematically correct patterns/stripes in feature boundaries Neither of these relate directly to deformation.
Diffstat (limited to 'game/terrain.cpp')
-rw-r--r--game/terrain.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/game/terrain.cpp b/game/terrain.cpp
index d2c8593..91a228f 100644
--- a/game/terrain.cpp
+++ b/game/terrain.cpp
@@ -30,14 +30,14 @@ Terrain::generateMeshes()
std::vector<Vertex> vertices;
vertices.reserve(geoData->n_vertices());
std::map<GeoData::VertexHandle, size_t> vertexIndex;
- std::transform(geoData->vertices_begin(), geoData->vertices_end(), std::back_inserter(vertices),
+ std::transform(geoData->vertices_sbegin(), geoData->vertices_end(), std::back_inserter(vertices),
[this, &vertexIndex](const GeoData::VertexHandle v) {
vertexIndex.emplace(v, vertexIndex.size());
const auto p = geoData->point(v);
- return Vertex {p, p / 10000, geoData->normal(v)};
+ return Vertex {p, RelativePosition2D(p) / 10000.F, geoData->normal(v)};
});
std::for_each(
- geoData->faces_begin(), geoData->faces_end(), [this, &vertexIndex, &indices](const GeoData::FaceHandle f) {
+ geoData->faces_sbegin(), geoData->faces_end(), [this, &vertexIndex, &indices](const GeoData::FaceHandle f) {
std::transform(geoData->fv_begin(f), geoData->fv_end(f), std::back_inserter(indices),
[&vertexIndex](const GeoData::VertexHandle v) {
return vertexIndex[v];