Skip to content

Commit

Permalink
Fixed flat terrain scale bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem committed Jul 5, 2020
1 parent 94a25d2 commit b3a2a3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/3d/qgs3dexportobject.h
Expand Up @@ -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 ) ); 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 //! 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 ) ); 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 * 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 * This expands the bounding box if the current object outside the bounds of the already established bounds
Expand Down
5 changes: 2 additions & 3 deletions src/3d/qgs3dsceneexporter.cpp
Expand Up @@ -398,7 +398,6 @@ void Qgs3DSceneExporter::parseFlatTile( QgsTerrainTileEntity *tileEntity )
} }


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


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


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


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


Expand Down

0 comments on commit b3a2a3c

Please sign in to comment.