summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-22 12:41:37 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-22 12:41:37 +0000
commit20308e0a8d62e575237310b7de919e9c7410a9d7 (patch)
treecb6d403321f1288bfdbc5c0e29583691661322ba /game/geoData.cpp
parentAdjust track height to blend into terrain (diff)
downloadilt-20308e0a8d62e575237310b7de919e9c7410a9d7.tar.bz2
ilt-20308e0a8d62e575237310b7de919e9c7410a9d7.tar.xz
ilt-20308e0a8d62e575237310b7de919e9c7410a9d7.zip
Store a generation number for GeoData
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index d15a51b..5771a2f 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -66,6 +66,7 @@ GeoData::loadFromAsciiGrid(const std::filesystem::path & input)
});
}
}
+ mesh.generation++;
mesh.updateAllVertexNormals();
return mesh;
@@ -106,6 +107,7 @@ GeoData::createFlat(GlobalPosition2D lower, GlobalPosition2D upper, GlobalDistan
}
mesh.updateAllVertexNormals();
+ mesh.generation++;
return mesh;
}
@@ -601,6 +603,13 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const
surfaceStripWalk(surfaceStripWalk, findPoint(strip.front().centroid()));
updateAllVertexNormals(newOrChangedVerts);
+ generation++;
+}
+
+size_t
+GeoData::getGeneration() const
+{
+ return generation;
}
void