Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qabstractcollisionshape_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef ABSTRACTCOLLISIONSHAPE_H
6#define ABSTRACTCOLLISIONSHAPE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
20#include <QtQuick3D/private/qquick3dnode_p.h>
21#include <QtQml/QQmlEngine>
22
23namespace physx {
24class PxGeometry;
25}
26
28
29class Q_QUICK3DPHYSICS_EXPORT QAbstractCollisionShape : public QQuick3DNode
30{
31 Q_OBJECT
32 Q_PROPERTY(bool enableDebugDraw READ enableDebugDraw WRITE setEnableDebugDraw NOTIFY
33 enableDebugDrawChanged)
34 QML_NAMED_ELEMENT(CollisionShape)
35 QML_UNCREATABLE("abstract interface")
36public:
37 explicit QAbstractCollisionShape(QQuick3DNode *parent = nullptr);
38 virtual ~QAbstractCollisionShape();
40 virtual physx::PxGeometry *getPhysXGeometry() = 0;
41 bool enableDebugDraw() const;
43 virtual bool isStaticShape() const = 0;
44
45public slots:
46 void setEnableDebugDraw(bool enableDebugDraw);
47
48signals:
49 void enableDebugDrawChanged(bool enableDebugDraw);
50 void needsRebuild(QObject *);
51
52protected:
53 bool m_scaleDirty = true;
54 QVector3D m_prevScale;
55
56private slots:
57 void handleScaleChange();
58
59private:
60 bool m_enableDebugDraw = false;
61};
62
64
65#endif // ABSTRACTCOLLISIONSHAPE_H
void createScene(float typicalLength, float typicalSpeed, const QVector3D &gravity, QPhysicsWorld *physicsWorld, unsigned int numThreads)
void createWorld()
SimulationEventCallback * callback
void deleteWorld()
physx::PxScene * scene
physx::PxControllerManager * controllerManager
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:178
SimulationEventCallback(QPhysicsWorld *worldIn)
void onConstraintBreak(physx::PxConstraintInfo *, physx::PxU32) override
virtual ~SimulationEventCallback()=default
void onContact(const physx::PxContactPairHeader &pairHeader, const physx::PxContactPair *pairs, physx::PxU32 nbPairs) override
void onAdvance(const physx::PxRigidBody *const *, const physx::PxTransform *, const physx::PxU32) override
void onWake(physx::PxActor **, physx::PxU32) override
void onTrigger(physx::PxTriggerPair *pairs, physx::PxU32 count) override
void onSleep(physx::PxActor **, physx::PxU32) override
PxTransformT< float > PxTransform
#define PHYSX_RELEASE(x)
static QT_BEGIN_NAMESPACE QAbstractCollisionShape * frontendShape(const physx::PxShape *shape)
static constexpr bool isBitSet(quint32 value, quint32 position)
static bool isFilteredOut(physx::PxFilterData filterData0, physx::PxFilterData filterData1)
static physx::PxFilterFlags contactReportFilterShader(physx::PxFilterObjectAttributes attributes0, physx::PxFilterData filterData0, physx::PxFilterObjectAttributes attributes1, physx::PxFilterData filterData1, physx::PxPairFlags &pairFlags, const void *, physx::PxU32)
#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
static StaticPhysXObjects & getReference()
physx::PxFoundation * foundation
physx::PxDefaultCpuDispatcher * dispatcher
physx::PxPhysics * physics