summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp')
-rw-r--r--tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp
index 1bed9fc44..1b65388af 100644
--- a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp
+++ b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp
@@ -50,7 +50,7 @@ Qt3DCore::QEntity *buildEntityAtDistance(float distance, Qt3DCore::QEntity *pare
// create geometry with a valid bounding volume - a single point is sufficient
auto geometry = new Qt3DRender::QGeometry;
- auto vertexBuffer = new Qt3DRender::QBuffer(Qt3DRender::QBuffer::VertexBuffer, geometry);
+ auto vertexBuffer = new Qt3DRender::QBuffer(geometry);
auto positionAttribute = new Qt3DRender::QAttribute;
positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName());
@@ -117,14 +117,20 @@ private Q_SLOTS:
{
Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity();
- Qt3DCore::QEntity *childEntity1 = new Qt3DCore::QEntity(rootEntity);
- Qt3DCore::QEntity *childEntity2 = new Qt3DCore::QEntity(rootEntity);
- Qt3DCore::QEntity *childEntity3 = new Qt3DCore::QEntity(rootEntity);
+ Qt3DCore::QEntity *targetEntity = new Qt3DCore::QEntity(rootEntity);
+ Qt3DCore::QEntity *childEntity1 = buildEntityAtDistance(50.0f, rootEntity);
+ Qt3DCore::QEntity *childEntity2 = buildEntityAtDistance(25.0f, rootEntity);
+ Qt3DCore::QEntity *childEntity3 = buildEntityAtDistance(75.0f, rootEntity);
+
+ Qt3DRender::QProximityFilter *proximityFilter = new Qt3DRender::QProximityFilter(rootEntity);
+ proximityFilter->setDistanceThreshold(200.0f);
+ proximityFilter->setEntity(targetEntity);
QTest::newRow("ShouldSelectAll") << rootEntity
- << Qt3DCore::QNodeIdVector()
+ << (Qt3DCore::QNodeIdVector() << proximityFilter->id())
<< (Qt3DCore::QNodeIdVector()
<< rootEntity->id()
+ << targetEntity->id()
<< childEntity1->id()
<< childEntity2->id()
<< childEntity3->id()