Skip to content

Commit

Permalink
Fix flat terrain implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Oct 28, 2024
1 parent 2b7cfa6 commit 00c35d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/3d/chunks/qgschunkloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ QVector<QgsChunkNode *> QgsQuadtreeChunkLoaderFactory::createChildren( QgsChunkN
for ( int i = 0; i < 4; ++i )
{
int dx = i & 1, dy = !!( i & 2 );
const QgsChunkNodeId childId( nodeId.d + 1, nodeId.x * 2 + dx, nodeId.y * 2 + ( dy ? 0 : 1 ) ); // TODO: inverse dy?
const QgsChunkNodeId childId( nodeId.d + 1, nodeId.x * 2 + dx, nodeId.y * 2 + dy );

const double chXMin = dx ? center.x() : box3D.xMinimum();
const double chXMax = dx ? box3D.xMaximum() : center.x();
Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsflatterraingenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Qt3DCore::QEntity *FlatTerrainChunkLoader::createEntity( Qt3DCore::QEntity *pare
const double yMin = commonExtent.yMinimum() - map->origin().y();

transform->setScale3D( QVector3D( xSide, 1, ySide ) );
transform->setTranslation( QVector3D( xMin + xSide / 2, 0, yMin + ySide / 2 ) );
transform->setTranslation( QVector3D( xMin + xSide / 2, 0, -( yMin + ySide / 2 ) ) );

createTextureComponent( entity, map->isTerrainShadingEnabled(), map->terrainShadingMaterial(), !map->layers().empty() );

Expand Down

0 comments on commit 00c35d1

Please sign in to comment.