summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qvectornd.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-01 17:18:05 +0100
committerLars Knoll <lars.knoll@qt.io>2020-11-19 12:28:45 +0100
commitbfceaf7eb3445e44a1e4d26fecd65cbd6e926928 (patch)
tree49c5e211350406e96a3c801ebc1cba5fd7332a3a /src/gui/math3d/qvectornd.cpp
parent5a61c88e1fee77db5c99837bf2d59630777b671a (diff)
De-inline qFuzzyCompare for QMatrix4x4 and QVector4D
Change-Id: Ic412d5cefcc1c41e90ee5cf98814469aec3a91f6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/math3d/qvectornd.cpp')
-rw-r--r--src/gui/math3d/qvectornd.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/math3d/qvectornd.cpp b/src/gui/math3d/qvectornd.cpp
index 5433e9bc6c..7362694987 100644
--- a/src/gui/math3d/qvectornd.cpp
+++ b/src/gui/math3d/qvectornd.cpp
@@ -397,6 +397,10 @@ QT_BEGIN_NAMESPACE
Returns \c true if \a v1 and \a v2 are equal, allowing for a small
fuzziness factor for floating-point comparisons; false otherwise.
*/
+bool qFuzzyCompare(QVector2D v1, QVector2D v2) noexcept
+{
+ return qFuzzyCompare(v1.v[0], v2.v[0]) && qFuzzyCompare(v1.v[1], v2.v[1]);
+}
#ifndef QT_NO_VECTOR3D
/*!
@@ -994,6 +998,12 @@ QVector3D QVector3D::unproject(const QMatrix4x4 &modelView, const QMatrix4x4 &pr
Returns \c true if \a v1 and \a v2 are equal, allowing for a small
fuzziness factor for floating-point comparisons; false otherwise.
*/
+bool qFuzzyCompare(QVector3D v1, QVector3D v2) noexcept
+{
+ return qFuzzyCompare(v1.v[0], v2.v[0]) &&
+ qFuzzyCompare(v1.v[1], v2.v[1]) &&
+ qFuzzyCompare(v1.v[2], v2.v[2]);
+}
#ifndef QT_NO_VECTOR2D
@@ -1502,6 +1512,13 @@ QDataStream &operator>>(QDataStream &stream, QVector3D &vector)
Returns \c true if \a v1 and \a v2 are equal, allowing for a small
fuzziness factor for floating-point comparisons; false otherwise.
*/
+bool qFuzzyCompare(QVector4D v1, QVector4D v2) noexcept
+{
+ return qFuzzyCompare(v1.v[0], v2.v[0]) &&
+ qFuzzyCompare(v1.v[1], v2.v[1]) &&
+ qFuzzyCompare(v1.v[2], v2.v[2]) &&
+ qFuzzyCompare(v1.v[3], v2.v[3]);
+}
#ifndef QT_NO_VECTOR2D