1 | // Copyright (C) 2021 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef ASSIMPUTILS_H |
5 | #define ASSIMPUTILS_H |
6 | |
7 | #include <QtCore/qglobal.h> |
8 | #include <QtQuick3DUtils/private/qssgmesh_p.h> |
9 | |
10 | struct aiScene; |
11 | struct aiMesh; |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class QString; |
16 | |
17 | namespace AssimpUtils |
18 | { |
19 | |
20 | using BoneIndexMap = QHash<QString, qint32>; |
21 | using MeshList = QVector<const aiMesh *>; |
22 | |
23 | QSSGMesh::Mesh generateMeshData(const aiScene &scene, |
24 | const MeshList &meshes, |
25 | bool useFloatJointIndices, |
26 | bool generateLevelsOfDetail, |
27 | float normalMergeAngle, |
28 | float normalSplitAngle, |
29 | QString &errorString); |
30 | |
31 | } |
32 | |
33 | inline size_t qHash(const QVector3D &vector, size_t seed = 0) { |
34 | if (vector.isNull()) |
35 | return seed; |
36 | return qHashBits(p: &vector, size: sizeof(float) * 3, seed); |
37 | } |
38 | |
39 | QT_END_NAMESPACE |
40 | |
41 | #endif // ASSIMPUTILS_H |
42 | |