38 QQmlListProperty<QAbstractCollisionShape> collisionShapes READ collisionShapes CONSTANT)
39 Q_PROPERTY(
bool sendContactReports READ sendContactReports WRITE setSendContactReports NOTIFY
40 sendContactReportsChanged)
41 Q_PROPERTY(
bool receiveContactReports READ receiveContactReports WRITE setReceiveContactReports
42 NOTIFY receiveContactReportsChanged)
43 Q_PROPERTY(
bool sendTriggerReports READ sendTriggerReports WRITE setSendTriggerReports NOTIFY
44 sendTriggerReportsChanged REVISION(6, 5))
45 Q_PROPERTY(
bool receiveTriggerReports READ receiveTriggerReports WRITE setReceiveTriggerReports
46 NOTIFY receiveTriggerReportsChanged REVISION(6, 5))
47 Q_PROPERTY(
int filterGroup READ filterGroup WRITE setfilterGroup NOTIFY filterGroupChanged
49 Q_PROPERTY(
int filterIgnoreGroups READ filterIgnoreGroups WRITE setFilterIgnoreGroups NOTIFY
50 filterIgnoreGroupsChanged REVISION(6, 7));
52 QML_NAMED_ELEMENT(PhysicsNode)
53 QML_UNCREATABLE(
"abstract interface")
55 QAbstractPhysicsNode();
56 ~QAbstractPhysicsNode() override;
58 QQmlListProperty<QAbstractCollisionShape> collisionShapes();
59 const QVector<QAbstractCollisionShape *> &getCollisionShapesList()
const;
61 void updateFromPhysicsTransform(
const physx::PxTransform &transform);
63 void registerContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
64 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
66 bool sendContactReports()
const;
67 void setSendContactReports(
bool sendContactReports);
69 bool receiveContactReports()
const;
70 void setReceiveContactReports(
bool receiveContactReports);
72 Q_REVISION(6, 5)
bool sendTriggerReports()
const;
73 Q_REVISION(6, 5)
void setSendTriggerReports(
bool sendTriggerReports);
75 Q_REVISION(6, 5)
bool receiveTriggerReports()
const;
76 Q_REVISION(6, 5)
void setReceiveTriggerReports(
bool receiveTriggerReports);
78 bool hasStaticShapes()
const {
return m_hasStaticShapes; }
80 virtual QAbstractPhysXNode *createPhysXBackend() = 0;
82 Q_REVISION(6, 7)
int filterGroup()
const;
83 Q_REVISION(6, 7)
void setfilterGroup(
int newfilterGroup);
85 Q_REVISION(6, 7)
int filterIgnoreGroups()
const;
86 Q_REVISION(6, 7)
void setFilterIgnoreGroups(
int newFilterIgnoreGroups);
89 void onShapeDestroyed(QObject *object);
90 void onShapeNeedsRebuild(QObject *object);
93 void bodyContact(QAbstractPhysicsNode *body,
const QVector<QVector3D> &positions,
94 const QVector<QVector3D> &impulses,
const QVector<QVector3D> &normals);
95 void sendContactReportsChanged(
float sendContactReports);
96 void receiveContactReportsChanged(
float receiveContactReports);
97 Q_REVISION(6, 5)
void sendTriggerReportsChanged(
float sendTriggerReports);
98 Q_REVISION(6, 5)
void receiveTriggerReportsChanged(
float receiveTriggerReports);
99 Q_REVISION(6, 5)
void enteredTriggerBody(QAbstractPhysicsNode *body);
100 Q_REVISION(6, 5)
void exitedTriggerBody(QAbstractPhysicsNode *body);
101 Q_REVISION(6, 7)
void filterGroupChanged();
102 Q_REVISION(6, 7)
void filterIgnoreGroupsChanged();
105 static void qmlAppendShape(QQmlListProperty<QAbstractCollisionShape> *list,
106 QAbstractCollisionShape *shape);
107 static QAbstractCollisionShape *qmlShapeAt(QQmlListProperty<QAbstractCollisionShape> *list,
109 static qsizetype qmlShapeCount(QQmlListProperty<QAbstractCollisionShape> *list);
110 static void qmlClearShapes(QQmlListProperty<QAbstractCollisionShape> *list);
112 QVector<QAbstractCollisionShape *> m_collisionShapes;
113 bool m_shapesDirty =
false;
114 bool m_sendContactReports =
false;
115 bool m_receiveContactReports =
false;
116 bool m_sendTriggerReports =
false;
117 bool m_receiveTriggerReports =
false;
118 bool m_hasStaticShapes =
false;
119 int m_filterGroup = 0;
120 int m_filterIgnoreGroups = 0;
121 bool m_filtersDirty =
false;
123 friend class QAbstractPhysXNode;
124 friend class QPhysicsWorld;
125 friend class SimulationEventCallback;
126 QAbstractPhysXNode *m_backendObject =
nullptr;