diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-02-17 15:15:50 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-02-19 13:46:13 +0000 |
commit | 7328700ee5622fbb635205592c97280a8f84817a (patch) | |
tree | 79b234ecc68175b5a3289f906ccb4d6258ec8321 /src/render/frontend/qlevelofdetail_p.h | |
parent | f22b372e812ee808ba2dd88bf345ef6f4fb635d1 (diff) |
Revert "Use QVector<float> in level of detail APIs"
This reverts commit 5bceaee38908934078bbdb62b564daa68f7e182b.
QML uses doubles throughout and there is no good way or place to
reliably switch to floats in the API. We tried extending
QtDeclarative to work with QJSValues containing vectors/lists of
floats and doubles (rather than qreal) but this introduces
rounding errors that are difficult to control robustly.
We also looked at removing the Q_PROPERTY in C++ and adding it
to a QML extension object. But that would make it not work with
animations bound to this property.
So, in the end, it seems like qreal is the best of a bad set
of alternatives. We should make a renewed effort to kill qreal
for Qt 6.
Change-Id: I9d61e58e7223eb5a6b848ba33fc760b3654bbddd
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render/frontend/qlevelofdetail_p.h')
-rw-r--r-- | src/render/frontend/qlevelofdetail_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/render/frontend/qlevelofdetail_p.h b/src/render/frontend/qlevelofdetail_p.h index 808959220..ab25e9ad3 100644 --- a/src/render/frontend/qlevelofdetail_p.h +++ b/src/render/frontend/qlevelofdetail_p.h @@ -73,7 +73,7 @@ public: QCamera *m_camera; int m_currentIndex; QLevelOfDetail::ThresholdType m_thresholdType; - QVector<float> m_thresholds; + QVector<qreal> m_thresholds; QPointer<QBoundingSphere> m_volumeOverride; }; @@ -82,7 +82,7 @@ struct QLevelOfDetailData Qt3DCore::QNodeId camera; int currentIndex; QLevelOfDetail::ThresholdType thresholdType; - QVector<float> thresholds; + QVector<qreal> thresholds; float radius; QVector3D center; }; |