Skip to content
Permalink
Browse files

Rename TerrainBoundsEntity to ChunkBoundsEntity

... since it can be used also for other chunked entities - not just terrain
  • Loading branch information
wonder-sk committed Jul 19, 2017
1 parent 3d0ce5f commit 04e12d9dcecbabbfdca0fddef1e0d2616d7d7b56
@@ -3,6 +3,7 @@

SET(QGIS_3D_SRCS
cameracontroller.cpp
chunkboundsentity.cpp
chunkedentity.cpp
chunklist.cpp
chunkloader.cpp
@@ -21,7 +22,6 @@ SET(QGIS_3D_SRCS
#quantizedmeshterraingenerator.cpp
scene.cpp
terrain.cpp
terrainboundsentity.cpp
terrainchunkloader.cpp
terraingenerator.cpp
tessellator.cpp
@@ -55,6 +55,7 @@ QT5_ADD_RESOURCES(QGIS_3D_RCC_SRCS shaders.qrc)
SET(QGIS_3D_HDRS
aabb.h
cameracontroller.h
chunkboundsentity.h
chunkedentity.h
chunklist.h
chunkloader.h
@@ -73,7 +74,6 @@ SET(QGIS_3D_HDRS
#quantizedmeshterraingenerator.h
scene.h
terrain.h
terrainboundsentity.h
terrainchunkloader.h
terraingenerator.h
tessellator.h
@@ -1,4 +1,4 @@
#include "terrainboundsentity.h"
#include "chunkboundsentity.h"

#include <Qt3DRender/QAttribute>
#include <Qt3DRender/QBuffer>
@@ -105,7 +105,7 @@ void AABBMesh::setBoxes( const QList<AABB> &bboxes )
// ----------------


TerrainBoundsEntity::TerrainBoundsEntity( Qt3DCore::QNode *parent )
ChunkBoundsEntity::ChunkBoundsEntity( Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent )
{
aabbMesh = new AABBMesh;
@@ -116,7 +116,7 @@ TerrainBoundsEntity::TerrainBoundsEntity( Qt3DCore::QNode *parent )
addComponent( bboxesMaterial );
}

void TerrainBoundsEntity::setBoxes( const QList<AABB> &bboxes )
void ChunkBoundsEntity::setBoxes( const QList<AABB> &bboxes )
{
aabbMesh->setBoxes( bboxes );
}
@@ -1,21 +1,21 @@
#ifndef TERRAINBOUNDSENTITY_H
#define TERRAINBOUNDSENTITY_H
#ifndef CHUNKBOUNDSENTITY_H
#define CHUNKBOUNDSENTITY_H

#include <Qt3DCore/QEntity>

class AABB;
class AABBMesh;

//! Draws bounds of axis aligned bounding boxes
class TerrainBoundsEntity : public Qt3DCore::QEntity
class ChunkBoundsEntity : public Qt3DCore::QEntity
{
public:
TerrainBoundsEntity( Qt3DCore::QNode *parent = nullptr );
ChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );

void setBoxes( const QList<AABB> &bboxes );

private:
AABBMesh *aabbMesh;
};

#endif // TERRAINBOUNDSENTITY_H
#endif // CHUNKBOUNDSENTITY_H
@@ -1,9 +1,10 @@
#include "chunkedentity.h"

#include "chunknode.h"
#include "chunkboundsentity.h"
#include "chunklist.h"
#include "chunkloader.h"
#include "terrainboundsentity.h"
#include "chunknode.h"


static float screenSpaceError( float epsilon, float distance, float screenSize, float fov )
{
@@ -195,7 +196,7 @@ void ChunkedEntity::setShowBoundingBoxes( bool enabled )

if ( enabled )
{
bboxesEntity = new TerrainBoundsEntity( this );
bboxesEntity = new ChunkBoundsEntity( this );
}
else
{
@@ -9,7 +9,7 @@ class AABB;
class ChunkNode;
class ChunkList;
class ChunkLoaderFactory;
class TerrainBoundsEntity;
class ChunkBoundsEntity;
class LoaderThread;

#include <QVector3D>
@@ -76,7 +76,7 @@ class ChunkedEntity : public Qt3DCore::QEntity
//! max. length for replacement queue
int maxLoadedChunks;

TerrainBoundsEntity *bboxesEntity;
ChunkBoundsEntity *bboxesEntity;

LoaderThread *loaderThread;
QMutex loaderMutex;

0 comments on commit 04e12d9

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