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_VECTOR3D_P_H
5#define QT3DCORE_VECTOR3D_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/vector3d_sse_p.h>
24
25QT_BEGIN_NAMESPACE
26using Vector3D = Qt3DCore::Vector3D_SSE;
27QT_END_NAMESPACE
28
29#else
30
31#include <QVector3D>
32
33QT_BEGIN_NAMESPACE
34using Vector3D = QVector3D;
35QT_END_NAMESPACE
36
37#endif
38
39template<typename UsingType>
40Q_ALWAYS_INLINE QVector3D convertToQVector3D(const UsingType &v)
41{
42 return v.toQVector3D();
43}
44
45template<>
46Q_ALWAYS_INLINE QVector3D convertToQVector3D<QVector3D>(const QVector3D &v)
47{
48 return v;
49}
50
51#endif // QT3DCORE_VECTOR3D_P_H
52

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