Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qheightfieldshape_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef HEIGHTFIELDMESHSHAPE_H
5#define HEIGHTFIELDMESHSHAPE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt 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 <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
19#include <QtQuick3DPhysics/private/qabstractcollisionshape_p.h>
20#include <QtCore/QObject>
21#include <QtGui/QVector3D>
22#include <QtQml/QQmlEngine>
23#include <QtQuick3D/QQuick3DGeometry>
24#include <QtQuick/private/qquickimage_p.h>
25
26namespace physx {
27class PxBoxGeometry;
28class PxTriangleMesh;
29class PxTriangleMeshGeometry;
30class PxHeightFieldGeometry;
31class PxHeightField;
32struct PxHeightFieldSample;
33}
34
36
38
40{
42 Q_PROPERTY(QVector3D extents READ extents WRITE setExtents NOTIFY extentsChanged)
43 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged REVISION(6, 5))
44 Q_PROPERTY(QQuickImage *image READ image WRITE setImage NOTIFY imageChanged REVISION(6, 7))
45 QML_NAMED_ELEMENT(HeightFieldShape)
46public:
49
50 physx::PxGeometry *getPhysXGeometry() override;
51
52 Q_REVISION(6, 5) const QUrl &source() const;
53 Q_REVISION(6, 5) void setSource(const QUrl &newSource);
54
55 const QVector3D &hfOffset() const { return m_hfOffset; }
56
57 const QVector3D &extents() const;
58 void setExtents(const QVector3D &newExtents);
59 bool isStaticShape() const override { return true; }
60
62 Q_REVISION(6, 7) void setImage(QQuickImage *newImage);
63
65 Q_REVISION(6, 5) void sourceChanged();
66 void extentsChanged();
67 Q_REVISION(6, 7) void imageChanged();
68
70 void imageDestroyed(QObject *image);
71 void imageGeometryChanged();
72
74 void updatePhysXGeometry();
75 void getSamples();
76 void updateExtents();
77
78 QQuick3DPhysicsHeightField *m_heightField = nullptr;
79
80 physx::PxHeightFieldGeometry *m_heightFieldGeometry = nullptr;
81 QVector3D m_hfOffset;
82 QUrl m_heightMapSource;
83 bool m_dirtyPhysx = false;
84 QVector3D m_extents = { 100, 100, 100 };
85 bool m_extentsSetExplicitly = false;
86 QQuickImage *m_image = nullptr;
87};
88
90
91#endif // HEIGHTFIELDMESHSHAPE_H
Q_REVISION(6, 7) QQuickImage *image() const
bool isStaticShape() const override
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
Definition qurl.h:94
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
Definition image.cpp:4
GLsizei GLsizei GLchar * source
#define QML_NAMED_ELEMENT(NAME)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define slots
#define signals
#define Q_QUICK3DPHYSICS_EXPORT