summaryrefslogtreecommitdiffstats
path: root/src/render/backend/levelofdetail_p.h
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-02-17 15:15:50 +0000
committerSean Harmer <sean.harmer@kdab.com>2017-02-19 13:46:13 +0000
commit7328700ee5622fbb635205592c97280a8f84817a (patch)
tree79b234ecc68175b5a3289f906ccb4d6258ec8321 /src/render/backend/levelofdetail_p.h
parentf22b372e812ee808ba2dd88bf345ef6f4fb635d1 (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/backend/levelofdetail_p.h')
-rw-r--r--src/render/backend/levelofdetail_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/render/backend/levelofdetail_p.h b/src/render/backend/levelofdetail_p.h
index c8d065883..83809a631 100644
--- a/src/render/backend/levelofdetail_p.h
+++ b/src/render/backend/levelofdetail_p.h
@@ -78,7 +78,7 @@ public:
Qt3DCore::QNodeId camera() const { return m_camera; }
int currentIndex() const { return m_currentIndex; }
QLevelOfDetail::ThresholdType thresholdType() const { return m_thresholdType; }
- QVector<float> thresholds() const { return m_thresholds; }
+ QVector<qreal> thresholds() const { return m_thresholds; }
float radius() const { return m_radius; }
QVector3D center() const { return m_center; }
@@ -89,7 +89,7 @@ private:
Qt3DCore::QNodeId m_camera;
int m_currentIndex;
QLevelOfDetail::ThresholdType m_thresholdType;
- QVector<float> m_thresholds;
+ QVector<qreal> m_thresholds;
float m_radius;
QVector3D m_center;
};