From 4ef82be21e11dddd436d4257b7a93ef7a4eb147d Mon Sep 17 00:00:00 2001 From: Neal_Nicdao Date: Sun, 16 Jun 2024 17:48:25 -0700 Subject: [PATCH] Update terrain.cpp: remove temporary code, add comment --- src/testapp/sessions/terrain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/testapp/sessions/terrain.cpp b/src/testapp/sessions/terrain.cpp index 59fb2afb..ffcd4e54 100644 --- a/src/testapp/sessions/terrain.cpp +++ b/src/testapp/sessions/terrain.cpp @@ -298,7 +298,13 @@ Session setup_terrain_subdiv_dist( vbufPosView[vbufVertex] = posOut + radialDir * heightmap(skPos); }; - if (true || rChGeo.originSkelPos == rTerrainFrame.position) + // TODO: Limit rChGeo.originSkelPos to always be near the surface. There isn't a point in + // translating the mesh when moving away from the terrain. + // Also add a threshold to only translate if the two positions diverge too far. Vary + // the threshold by the maximum present subdivision level, so less translations are + // needed when moving across low-detail terrain. + + if (rChGeo.originSkelPos == rTerrainFrame.position) { // Copy offsetted positions from the skeleton for newly added shared vertices