diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-03-10 11:26:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-10 16:04:28 +0100 |
commit | 4c9885a0f580c8273a211a92b6fc55af1d4f03c0 (patch) | |
tree | 819df2d0e6a660212947cd1acc4a31be2370bf75 /src/gui/math3d/qvector3d.h | |
parent | 267eab3f398646b59f5773173cd22a97b8e9540a (diff) |
Revert some previously added constexpr in QVector?d classes
This commit partly reverts cd91d8ad0281c984a01b8091696a6fdfdfa69514.
The revert is required as the used ifdef relied on undefined
compiler behavior. Especially Windows has had trouble. The revert reduces
the risk of breaks by future compilers.
The proper inline and constexpr has to wait until Qt 6.
Task-number: QTBUG-37122
Change-Id: I881fffb95fa46d9c170c9420a578f15640e18aea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui/math3d/qvector3d.h')
-rw-r--r-- | src/gui/math3d/qvector3d.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 64f8e34704..51412a940a 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -95,17 +95,9 @@ public: QVector3D &operator*=(const QVector3D& vector); QVector3D &operator/=(float divisor); -#if defined(QT_BUILD_GUI_LIB) && !defined(QT_STATIC) - static float dotProduct(const QVector3D& v1, const QVector3D& v2); - static QVector3D crossProduct(const QVector3D& v1, const QVector3D& v2); -#else - Q_DECL_CONSTEXPR inline static float dotProduct(const QVector3D& v1, const QVector3D& v2) - { return v1.xp * v2.xp + v1.yp * v2.yp + v1.zp * v2.zp; } - Q_DECL_CONSTEXPR inline static QVector3D crossProduct(const QVector3D& v1, const QVector3D& v2) - { return QVector3D(v1.yp * v2.zp - v1.zp * v2.yp, - v1.zp * v2.xp - v1.xp * v2.zp, - v1.xp * v2.yp - v1.yp * v2.xp); } -#endif + static float dotProduct(const QVector3D& v1, const QVector3D& v2); //In Qt 6 convert to inline and constexpr + static QVector3D crossProduct(const QVector3D& v1, const QVector3D& v2); //in Qt 6 convert to inline and constexpr + static QVector3D normal(const QVector3D& v1, const QVector3D& v2); static QVector3D normal (const QVector3D& v1, const QVector3D& v2, const QVector3D& v3); |