mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
[3d] fix inevitable crashes when terrain bounding boxes were shown
The list of vertices just kept growing and growing (and we didn't even need another copy!)
This commit is contained in:
parent
222f0a0355
commit
528c8a63bf
@ -48,9 +48,9 @@ void LineMeshGeometry::setVertices( const QList<QVector3D> &vertices )
|
||||
rawVertexArray[idx++] = v.x();
|
||||
rawVertexArray[idx++] = v.y();
|
||||
rawVertexArray[idx++] = v.z();
|
||||
mVertices.append( v );
|
||||
}
|
||||
|
||||
mVertexCount = vertices.count();
|
||||
mVertexBuffer->setData( vertexBufferData );
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class LineMeshGeometry : public Qt3DRender::QGeometry
|
||||
|
||||
int vertexCount()
|
||||
{
|
||||
return mVertices.size();
|
||||
return mVertexCount;
|
||||
}
|
||||
|
||||
void setVertices( const QList<QVector3D> &vertices );
|
||||
@ -75,7 +75,7 @@ class LineMeshGeometry : public Qt3DRender::QGeometry
|
||||
private:
|
||||
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
|
||||
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
|
||||
QList<QVector3D> mVertices;
|
||||
int mVertexCount = 0;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user