summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3dextras
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2017-02-16 18:43:53 +0000
committerSean Harmer <sean.harmer@kdab.com>2017-02-24 11:16:02 +0000
commitddc878f2fc978a3b740b7ccf9258c824c6ba959a (patch)
treecfad9b1ded31b3cb6490fa5128742e8aff0cf1d5 /src/quick3d/quick3dextras
parent42af57acc976cf3142623ac2b13dabbfcf9e643a (diff)
QBoundingSphere cleanup
Is now a Q_GADGET value type Added QBoundingSphere creator functions on QLevelOfDetails and Quick3DLevelOfDetailsLoader Note: cannot be a nested type on QLevelOfDetails as moc doesn't support it Task-number: QTBUG-58892 Change-Id: Ic7b6d68c6e1119c1f61a858f49379efc1e9c2104 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3dextras')
-rw-r--r--src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp11
-rw-r--r--src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h10
2 files changed, 14 insertions, 7 deletions
diff --git a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp
index f3d3f4323..087342063 100644
--- a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp
+++ b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "quick3dlevelofdetailloader_p_p.h"
-#include <Qt3DRender/qboundingsphere.h>
+#include <Qt3DRender/qlevelofdetailboundingsphere.h>
#include <Qt3DRender/qcamera.h>
#include <Qt3DQuick/private/quick3dentityloader_p.h>
@@ -156,13 +156,18 @@ void Quick3DLevelOfDetailLoader::setThresholds(const QVector<qreal> &thresholds)
d->m_lod->setThresholds(thresholds);
}
-Qt3DRender::QBoundingSphere *Quick3DLevelOfDetailLoader::volumeOverride() const
+Qt3DRender::QLevelOfDetailBoundingSphere Quick3DLevelOfDetailLoader::createBoundingSphere(const QVector3D &center, float radius)
+{
+ return Qt3DRender::QLevelOfDetailBoundingSphere(center, radius);
+}
+
+Qt3DRender::QLevelOfDetailBoundingSphere Quick3DLevelOfDetailLoader::volumeOverride() const
{
Q_D(const Quick3DLevelOfDetailLoader);
return d->m_lod->volumeOverride();
}
-void Quick3DLevelOfDetailLoader::setVolumeOverride(Qt3DRender::QBoundingSphere *volumeOverride)
+void Quick3DLevelOfDetailLoader::setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride)
{
Q_D(Quick3DLevelOfDetailLoader);
d->m_lod->setVolumeOverride(volumeOverride);
diff --git a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h
index 1ef359fe7..445e7bca6 100644
--- a/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h
+++ b/src/quick3d/quick3dextras/items/quick3dlevelofdetailloader_p.h
@@ -72,7 +72,7 @@ class QT3DQUICKEXTRASSHARED_PRIVATE_EXPORT Quick3DLevelOfDetailLoader : public Q
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType READ thresholdType WRITE setThresholdType NOTIFY thresholdTypeChanged)
Q_PROPERTY(QVector<qreal> thresholds READ thresholds WRITE setThresholds NOTIFY thresholdsChanged)
- Q_PROPERTY(Qt3DRender::QBoundingSphere *volumeOverride READ volumeOverride WRITE setVolumeOverride NOTIFY volumeOverrideChanged)
+ Q_PROPERTY(Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride READ volumeOverride WRITE setVolumeOverride NOTIFY volumeOverrideChanged)
Q_PROPERTY(QObject *entity READ entity NOTIFY entityChanged)
Q_PROPERTY(QUrl source READ source NOTIFY sourceChanged)
@@ -90,13 +90,15 @@ public:
void setThresholdType(Qt3DRender::QLevelOfDetail::ThresholdType thresholdType);
QVector<qreal> thresholds() const;
void setThresholds(const QVector<qreal> &thresholds);
- Qt3DRender::QBoundingSphere *volumeOverride() const;
- void setVolumeOverride(Qt3DRender::QBoundingSphere *volumeOverride);
+ Qt3DRender::QLevelOfDetailBoundingSphere volumeOverride() const;
+ void setVolumeOverride(const Qt3DRender::QLevelOfDetailBoundingSphere &volumeOverride);
+
+ Q_INVOKABLE Qt3DRender::QLevelOfDetailBoundingSphere createBoundingSphere(const QVector3D &center, float radius);
QObject *entity() const;
QUrl source() const;
-signals:
+Q_SIGNALS:
void sourcesChanged();
void cameraChanged();
void currentIndexChanged();