18#include <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
20#include <QtCore/QLoggingCategory>
21#include <QtCore/QObject>
22#include <QtCore/QTimerEvent>
23#include <QtCore/QElapsedTimer>
24#include <QtGui/QVector3D>
25#include <QtQml/qqml.h>
28#include <QtQuick3D/private/qquick3dviewport_p.h>
38class PxControllerManager;
47class QAbstractRigidBody;
59 Q_PROPERTY(
bool forceDebugDraw READ forceDebugDraw WRITE setForceDebugDraw NOTIFY
60 forceDebugDrawChanged)
61 Q_PROPERTY(
bool enableCCD READ enableCCD WRITE setEnableCCD NOTIFY enableCCDChanged)
62 Q_PROPERTY(
float typicalLength READ typicalLength WRITE setTypicalLength NOTIFY
65 float typicalSpeed READ typicalSpeed WRITE setTypicalSpeed NOTIFY typicalSpeedChanged)
66 Q_PROPERTY(
float defaultDensity READ defaultDensity WRITE setDefaultDensity NOTIFY
67 defaultDensityChanged)
70 Q_PROPERTY(
float minimumTimestep READ minimumTimestep WRITE setMinimumTimestep NOTIFY
71 minimumTimestepChanged REVISION(6, 5))
72 Q_PROPERTY(
float maximumTimestep READ maximumTimestep WRITE setMaximumTimestep NOTIFY
73 maximumTimestepChanged REVISION(6, 5))
88 bool forceDebugDraw()
const;
89 bool enableCCD()
const;
90 float typicalLength()
const;
91 float typicalSpeed()
const;
92 float defaultDensity()
const;
104 void setHasIndividualDebugDraw();
105 physx::PxControllerManager *controllerManager();
111 void setForceDebugDraw(
bool forceDebugDraw);
112 void setEnableCCD(
bool enableCCD);
113 void setTypicalLength(
float typicalLength);
114 void setTypicalSpeed(
float typicalSpeed);
115 void setDefaultDensity(
float defaultDensity);
124 void enableCCDChanged(
bool enableCCD);
125 void forceDebugDrawChanged(
bool forceDebugDraw);
126 void typicalLengthChanged(
float typicalLength);
127 void typicalSpeedChanged(
float typicalSpeed);
128 void defaultDensityChanged(
float defaultDensity);
130 Q_REVISION(6, 5)
void minimumTimestepChanged(
float minimumTimestep);
131 Q_REVISION(6, 5)
void maximumTimestepChanged(
float maxTimestep);
132 void simulateFrame(
float minTimestep,
float maxTimestep);
137 void frameFinished(
float deltaTime);
139 void cleanupRemovedNodes();
140 void updateDebugDraw();
141 void disableDebugDraw();
142 void matchOrphanNodes();
143 void findPhysicsNodes();
145 struct DebugModelHolder
151 void setHalfExtents(
const QVector3D &halfExtents) {
data = halfExtents; }
153 float radius()
const {
return data.
x(); }
154 void setRadius(
float radius) {
data.setX(radius); }
156 float heightScale()
const {
return data.x(); }
157 void setHeightScale(
float heightScale) {
data.setX(heightScale); }
159 float halfHeight()
const {
return data.y(); }
160 void setHalfHeight(
float halfHeight) {
data.setY(halfHeight); }
162 float rowScale()
const {
return data.y(); }
163 void setRowScale(
float rowScale) {
data.setY(rowScale); }
165 float columnScale()
const {
return data.z(); }
166 void setColumnScale(
float columnScale) {
data.setZ(columnScale); }
172 m_collisionShapeDebugModels;
174 QMutex m_removedPhysicsNodesMutex;
177 float m_typicalLength = 100.f;
178 float m_typicalSpeed = 1000.f;
179 float m_defaultDensity = 0.001f;
180 float m_minTimestep = 16.667f;
181 float m_maxTimestep = 33.333f;
184 bool m_forceDebugDraw =
false;
187 bool m_hasIndividualDebugDraw =
false;
188 bool m_physicsInitialized =
false;
189 bool m_enableCCD =
false;
201 static physx::PxPhysics *getPhysics();
202 static physx::PxCooking *getCooking();
Q_REVISION(6, 5) float minimumTimestep() const
The QQmlParserStatus class provides updates on the QML parser state.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
The QVector3D class represents a vector or vertex in 3D space.
constexpr float x() const noexcept
Returns the x coordinate of this point.
Combined button and popup list for selecting options.
static Q_CONSTINIT QBasicAtomicInt running
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QML_NAMED_ELEMENT(NAME)
#define Q_QUICK3DPHYSICS_EXPORT
QSqlQueryModel * model
[16]
view viewport() -> scroll(dx, dy, deviceRect)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent