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_MATRIX4X4_P_H
5#define QT3DCORE_MATRIX4X4_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 QMatrix4x4
21#if defined(__SSE2__)
22
23#include <Qt3DCore/private/matrix4x4_sse_p.h>
24
25QT_BEGIN_NAMESPACE
26using Matrix4x4 = Qt3DCore::Matrix4x4_SSE;
27QT_END_NAMESPACE
28
29#else
30
31#include <QMatrix4x4>
32
33QT_BEGIN_NAMESPACE
34using Matrix4x4 = QMatrix4x4;
35QT_END_NAMESPACE
36
37#endif
38
39template<typename UsingType>
40Q_ALWAYS_INLINE QMatrix4x4 convertToQMatrix4x4(const UsingType &v)
41{
42 return v.toQMatrix4x4();
43}
44
45template<>
46Q_ALWAYS_INLINE QMatrix4x4 convertToQMatrix4x4<QMatrix4x4>(const QMatrix4x4 &v)
47{
48 return v;
49}
50
51#endif // QT3DCORE_MATRIX4X4_P_H
52

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