39 QQmlListProperty<QAbstractCollisionShape> collisionShapes READ collisionShapes CONSTANT)
40 Q_PROPERTY(
bool sendContactReports READ sendContactReports WRITE setSendContactReports NOTIFY
41 sendContactReportsChanged)
42 Q_PROPERTY(
bool receiveContactReports READ receiveContactReports WRITE setReceiveContactReports
43 NOTIFY receiveContactReportsChanged)
44 Q_PROPERTY(
bool sendTriggerReports READ sendTriggerReports WRITE setSendTriggerReports NOTIFY
45 sendTriggerReportsChanged REVISION(6, 5))
46 Q_PROPERTY(
bool receiveTriggerReports READ receiveTriggerReports WRITE setReceiveTriggerReports
47 NOTIFY receiveTriggerReportsChanged REVISION(6, 5))
48 Q_PROPERTY(
int filterGroup READ filterGroup WRITE setfilterGroup NOTIFY filterGroupChanged
50 Q_PROPERTY(
int filterIgnoreGroups READ filterIgnoreGroups WRITE setFilterIgnoreGroups NOTIFY
51 filterIgnoreGroupsChanged REVISION(6, 7));
56 QAbstractPhysicsNode();
57 ~QAbstractPhysicsNode() override;
59 QQmlListProperty<QAbstractCollisionShape> collisionShapes();
60 const QVector<QAbstractCollisionShape *> &getCollisionShapesList()
const;
62 void updateFromPhysicsTransform(
const physx::PxTransform &transform);
64 void registerContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
65 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
67 bool sendContactReports()
const;
68 void setSendContactReports(
bool sendContactReports);
70 bool receiveContactReports()
const;
71 void setReceiveContactReports(
bool receiveContactReports);
74 Q_REVISION(6, 5)
void setSendTriggerReports(
bool sendTriggerReports);
76 Q_REVISION(6, 5)
bool receiveTriggerReports()
const;
77 Q_REVISION(6, 5)
void setReceiveTriggerReports(
bool receiveTriggerReports);
79 bool hasStaticShapes()
const {
return m_hasStaticShapes; }
81 virtual QAbstractPhysXNode *createPhysXBackend() = 0;
84 Q_REVISION(6, 7)
void setfilterGroup(
int newfilterGroup);
86 Q_REVISION(6, 7)
int filterIgnoreGroups()
const;
87 Q_REVISION(6, 7)
void setFilterIgnoreGroups(
int newFilterIgnoreGroups);
90 void onShapeDestroyed(QObject *object);
91 void onShapeNeedsRebuild(QObject *object);
94 void bodyContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
95 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
96 void sendContactReportsChanged(
float sendContactReports);
97 void receiveContactReportsChanged(
float receiveContactReports);
98 Q_REVISION(6, 5)
void sendTriggerReportsChanged(
float sendTriggerReports);
99 Q_REVISION(6, 5)
void receiveTriggerReportsChanged(
float receiveTriggerReports);
100 Q_REVISION(6, 5)
void enteredTriggerBody(QAbstractPhysicsNode *body);
101 Q_REVISION(6, 5)
void exitedTriggerBody(QAbstractPhysicsNode *body);
103 Q_REVISION(6, 7)
void filterIgnoreGroupsChanged();
106 static void qmlAppendShape(QQmlListProperty<QAbstractCollisionShape> *list,
107 QAbstractCollisionShape *shape);
108 static QAbstractCollisionShape *qmlShapeAt(QQmlListProperty<QAbstractCollisionShape> *list,
110 static qsizetype qmlShapeCount(QQmlListProperty<QAbstractCollisionShape> *list);
111 static void qmlClearShapes(QQmlListProperty<QAbstractCollisionShape> *list);
113 QVector<QAbstractCollisionShape *> m_collisionShapes;
114 bool m_shapesDirty =
false;
115 bool m_sendContactReports =
false;
116 bool m_receiveContactReports =
false;
117 bool m_sendTriggerReports =
false;
118 bool m_receiveTriggerReports =
false;
119 bool m_hasStaticShapes =
false;
120 int m_filterGroup = 0;
121 int m_filterIgnoreGroups = 0;
122 bool m_filtersDirty =
false;
124 friend class QPhysicsJoint;
125 friend class QAbstractPhysXNode;
126 friend class QPhysicsWorld;
127 friend class SimulationEventCallback;
128 QAbstractPhysXNode *m_backendObject =
nullptr;
void markDirtyShapes() override
void buildShapes(QPhysXWorld *physX)
void rebuildDirtyShapes(QPhysicsWorld *world, QPhysXWorld *physX) override
void init(QPhysicsWorld *world, QPhysXWorld *physX) override
bool debugGeometryCapability() override
void cleanup(QPhysXWorld *physX) override
physx::PxRigidActor * actor
virtual void createActor(QPhysXWorld *physX)
void sync(float deltaTime, QHash< QQuick3DNode *, QMatrix4x4 > &transformCache) override
void updateFilters() override
physx::PxTransform getGlobalPose() override