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