37 QQmlListProperty<QAbstractCollisionShape> collisionShapes READ collisionShapes CONSTANT)
38 Q_PROPERTY(
bool sendContactReports READ sendContactReports WRITE setSendContactReports NOTIFY
39 sendContactReportsChanged)
40 Q_PROPERTY(
bool receiveContactReports READ receiveContactReports WRITE setReceiveContactReports
41 NOTIFY receiveContactReportsChanged)
42 Q_PROPERTY(
bool sendTriggerReports READ sendTriggerReports WRITE setSendTriggerReports NOTIFY
43 sendTriggerReportsChanged REVISION(6, 5))
44 Q_PROPERTY(
bool receiveTriggerReports READ receiveTriggerReports WRITE setReceiveTriggerReports
45 NOTIFY receiveTriggerReportsChanged REVISION(6, 5))
46 Q_PROPERTY(
int filterGroup READ filterGroup WRITE setfilterGroup NOTIFY filterGroupChanged
48 Q_PROPERTY(
int filterIgnoreGroups READ filterIgnoreGroups WRITE setFilterIgnoreGroups NOTIFY
49 filterIgnoreGroupsChanged REVISION(6, 7));
51 QML_NAMED_ELEMENT(PhysicsNode)
52 QML_UNCREATABLE(
"abstract interface")
54 QAbstractPhysicsNode();
55 ~QAbstractPhysicsNode() override;
57 QQmlListProperty<QAbstractCollisionShape> collisionShapes();
58 const QVector<QAbstractCollisionShape *> &getCollisionShapesList()
const;
60 void updateFromPhysicsTransform(
const physx::PxTransform &transform);
62 void registerContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
63 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
65 bool sendContactReports()
const;
66 void setSendContactReports(
bool sendContactReports);
68 bool receiveContactReports()
const;
69 void setReceiveContactReports(
bool receiveContactReports);
71 Q_REVISION(6, 5)
bool sendTriggerReports()
const;
72 Q_REVISION(6, 5)
void setSendTriggerReports(
bool sendTriggerReports);
74 Q_REVISION(6, 5)
bool receiveTriggerReports()
const;
75 Q_REVISION(6, 5)
void setReceiveTriggerReports(
bool receiveTriggerReports);
77 bool hasStaticShapes()
const {
return m_hasStaticShapes; }
79 virtual QAbstractPhysXNode *createPhysXBackend() = 0;
81 Q_REVISION(6, 7)
int filterGroup()
const;
82 Q_REVISION(6, 7)
void setfilterGroup(
int newfilterGroup);
84 Q_REVISION(6, 7)
int filterIgnoreGroups()
const;
85 Q_REVISION(6, 7)
void setFilterIgnoreGroups(
int newFilterIgnoreGroups);
88 void onShapeDestroyed(QObject *object);
89 void onShapeNeedsRebuild(QObject *object);
92 void bodyContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
93 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
94 void sendContactReportsChanged(
float sendContactReports);
95 void receiveContactReportsChanged(
float receiveContactReports);
96 Q_REVISION(6, 5)
void sendTriggerReportsChanged(
float sendTriggerReports);
97 Q_REVISION(6, 5)
void receiveTriggerReportsChanged(
float receiveTriggerReports);
98 Q_REVISION(6, 5)
void enteredTriggerBody(QAbstractPhysicsNode *body);
99 Q_REVISION(6, 5)
void exitedTriggerBody(QAbstractPhysicsNode *body);
100 Q_REVISION(6, 7)
void filterGroupChanged();
101 Q_REVISION(6, 7)
void filterIgnoreGroupsChanged();
104 static void qmlAppendShape(QQmlListProperty<QAbstractCollisionShape> *list,
105 QAbstractCollisionShape *shape);
106 static QAbstractCollisionShape *qmlShapeAt(QQmlListProperty<QAbstractCollisionShape> *list,
108 static qsizetype qmlShapeCount(QQmlListProperty<QAbstractCollisionShape> *list);
109 static void qmlClearShapes(QQmlListProperty<QAbstractCollisionShape> *list);
111 QVector<QAbstractCollisionShape *> m_collisionShapes;
112 bool m_shapesDirty =
false;
113 bool m_sendContactReports =
false;
114 bool m_receiveContactReports =
false;
115 bool m_sendTriggerReports =
false;
116 bool m_receiveTriggerReports =
false;
117 bool m_hasStaticShapes =
false;
118 int m_filterGroup = 0;
119 int m_filterIgnoreGroups = 0;
120 bool m_filtersDirty =
false;
122 friend class QAbstractPhysXNode;
123 friend class QPhysicsWorld;
124 friend class SimulationEventCallback;
125 QAbstractPhysXNode *m_backendObject =
nullptr;