1// Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DCORE_VECTOR4D_P_H
5#define QT3DCORE_VECTOR4D_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt3D API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qsimd_p.h>
19
20// Check if we can use the optimized version of QVector3D
21#if defined(__SSE2__)
22
23#include <Qt3DCore/private/vector4d_sse_p.h>
24
25QT_BEGIN_NAMESPACE
26using Vector4D = Qt3DCore::Vector4D_SSE;
27QT_END_NAMESPACE
28
29#else
30
31#include <QVector4D>
32
33QT_BEGIN_NAMESPACE
34using Vector4D = QVector4D;
35QT_END_NAMESPACE
36
37#endif
38
39template<typename UsingType>
40Q_ALWAYS_INLINE QVector4D convertToQVector4D(const UsingType &v)
41{
42 return v.toQVector4D();
43}
44
45template<>
46Q_ALWAYS_INLINE QVector4D convertToQVector4D<QVector4D>(const QVector4D &v)
47{
48 return v;
49}
50
51#endif // QT3DCORE_VECTOR4D_P_H
52

source code of qt3d/src/core/transforms/vector4d_p.h