Skip to content
Permalink
Browse files

Fixed flat terrain scale bug

  • Loading branch information
NEDJIMAbelgacem committed Jul 5, 2020
1 parent 94a25d2 commit b3a2a3c337a5d29f1242df43926bd370673ad62c
Showing with 3 additions and 3 deletions.
  1. +1 −0 src/3d/qgs3dexportobject.h
  2. +2 −3 src/3d/qgs3dsceneexporter.cpp
@@ -53,6 +53,7 @@ class Qgs3DExportObject : public QObject
void setupPositionCoordinates( const QVector<float> &positionsBuffer, float scale = 1.0f, const QVector3D translation = QVector3D( 0, 0, 0 ) );
//! Sets positions coordinates from just one positions buffer and indexes buffer and does the translation and scaling
void setupPositionCoordinates( const QVector<float> &positionsBuffer, const QVector<unsigned int> &facesIndexes, float scale = 1.0f, const QVector3D translation = QVector3D( 0, 0, 0 ) );

/**
* Updates the box bounds explained with the current object bounds
* This expands the bounding box if the current object outside the bounds of the already established bounds
@@ -398,7 +398,6 @@ void Qgs3DSceneExporter::parseFlatTile( QgsTerrainTileEntity *tileEntity )
}

float scale = transform->scale();
QVector3D translation = transform->translation();

QVector<float> positionBuffer = createPlaneVertexData( scale, scale, tileGeometry->resolution() );
QVector<unsigned int> indexesBuffer = createPlaneIndexData( tileGeometry->resolution() );
@@ -407,7 +406,7 @@ void Qgs3DSceneExporter::parseFlatTile( QgsTerrainTileEntity *tileEntity )
mObjects.push_back( object );

object->setSmoothEdges( mSmoothEdges );
object->setupPositionCoordinates( positionBuffer, indexesBuffer, scale, translation );
object->setupPositionCoordinates( positionBuffer, indexesBuffer );
}

void Qgs3DSceneExporter::parseDemTile( QgsTerrainTileEntity *tileEntity )
@@ -433,7 +432,7 @@ void Qgs3DSceneExporter::parseDemTile( QgsTerrainTileEntity *tileEntity )
DemTerrainTileGeometry *tileGeometry = qobject_cast<DemTerrainTileGeometry *>( geometry );
if ( tileGeometry == nullptr )
{
qDebug() << "WARNING : " << "Qt3DExtras::QPlaneGeometry* is expected at " << __FILE__ << ":" << __LINE__;
qDebug() << "WARNING : " << "DemTerrainTileGeometry* is expected at " << __FILE__ << ":" << __LINE__;
return;
}

0 comments on commit b3a2a3c

Please sign in to comment.
You can’t perform that action at this time.