Skip to content

Commit

Permalink
Revert TileMesher changes that were causing missing triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Jul 16, 2024
1 parent 4c561c8 commit f02c28b
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 272 deletions.
4 changes: 2 additions & 2 deletions src/osgEarth/TerrainTileModelFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ TerrainTileModelFactory::addMesh(

// test.
MeshConstraint clamp;
clamp.clampMesh = true;
clamp.pool = map->getElevationPool();
//clamp.clampMesh = true;
//clamp.pool = map->getElevationPool();
constraints.emplace_back(std::move(clamp));

model->mesh = mesher.createMesh(key, constraints, progress);
Expand Down
15 changes: 4 additions & 11 deletions src/osgEarth/TileMesher
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#pragma once
#ifndef OSGEARTH_TILE_MESHER
#define OSGEARTH_TILE_MESHER 1

#include <osgEarth/Common>
#include <osgEarth/TileKey>
Expand All @@ -31,18 +32,12 @@

namespace osgEarth
{
class ElevationPool;

/**
* Represents a single edit operation driven by a feature collection
*/
struct MeshConstraint
{
FeatureList features;
ElevationPool* pool = nullptr;
bool cutMesh = true; // should we cut the mesh with the constraint data?
bool flattenMesh = false; // should we flatten the mesh to the constraint data?
bool clampMesh = false; // should we clamp the mesh to the elevation data?
bool hasElevation = false; // do the features contain valid elevation data in Z?
bool removeInterior = false; // should we remove triangles inside polygons?
bool removeExterior = false; // should we remove triangles outside polygons?
Expand Down Expand Up @@ -74,10 +69,6 @@ namespace osgEarth
TileMesh(const TileMesh& m);
TileMesh(TileMesh&& m);
TileMesh& operator = (const TileMesh&);

inline bool valid() const {
return verts.valid() && indices.valid();
}
};

/**
Expand Down Expand Up @@ -137,3 +128,5 @@ namespace osgEarth
Cancelable* progress) const;
};
}

#endif // OSGEARTH_TILE_MESHER
Loading

0 comments on commit f02c28b

Please sign in to comment.