Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmeshshape_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef MESHSHAPE_H
6#define MESHSHAPE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
20#include <QtQuick3DPhysics/private/qabstractcollisionshape_p.h>
21#include <QtCore/QObject>
22#include <QtGui/QVector3D>
23#include <QtQml/QQmlEngine>
24#include <QtQuick3D/QQuick3DGeometry>
25
26namespace physx {
27class PxBoxGeometry;
28class PxConvexMesh;
29class PxConvexMeshGeometry;
30class PxTriangleMesh;
31class PxTriangleMeshGeometry;
32}
33
34QT_BEGIN_NAMESPACE
35class QQuick3DPhysicsMesh;
36
37class Q_QUICK3DPHYSICS_EXPORT QMeshShape : public QAbstractCollisionShape
38{
39 Q_OBJECT
40 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged REVISION(6, 5))
41 Q_PROPERTY(QQuick3DGeometry *geometry READ geometry WRITE setGeometry NOTIFY geometryChanged
42 REVISION(6, 7))
43 QML_NAMED_ELEMENT(MeshShape)
44 QML_UNCREATABLE("abstract interface")
45
46public:
47 ~QMeshShape();
48
49 enum class MeshType { TRIANGLE, CONVEX };
50 virtual MeshType shapeType() const = 0;
51
52 physx::PxGeometry *getPhysXGeometry() override;
53
54 Q_REVISION(6, 5) const QUrl &source() const;
55 Q_REVISION(6, 5) void setSource(const QUrl &newSource);
56 Q_REVISION(6, 7) QQuick3DGeometry *geometry() const;
57 Q_REVISION(6, 7) void setGeometry(QQuick3DGeometry *newGeometry);
58
59signals:
60 Q_REVISION(6, 5) void sourceChanged();
61 Q_REVISION(6, 7) void geometryChanged();
62
63private slots:
64 void geometryDestroyed(QObject *geometry);
65 void geometryContentChanged();
66
67private:
68 void updatePhysXGeometry();
69
70 bool m_dirtyPhysx = false;
71 physx::PxConvexMeshGeometry *m_convexGeometry = nullptr;
72 physx::PxTriangleMeshGeometry *m_triangleGeometry = nullptr;
73 QUrl m_meshSource;
74 QQuick3DPhysicsMesh *m_mesh = nullptr;
75 QQuick3DGeometry *m_geometry = nullptr;
76};
77
78QT_END_NAMESPACE
79
80#endif // MESHSHAPE_H
Combined button and popup list for selecting options.