5#ifndef ABSTRACTCOLLISIONSHAPE_H
6#define ABSTRACTCOLLISIONSHAPE_H
19#include <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
20#include <QtQuick3D/private/qquick3dnode_p.h>
21#include <QtQml/QQmlEngine>
32 Q_PROPERTY(
bool enableDebugDraw READ enableDebugDraw WRITE setEnableDebugDraw NOTIFY
33 enableDebugDrawChanged)
34 QML_NAMED_ELEMENT(CollisionShape)
35 QML_UNCREATABLE(
"abstract interface")
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;
46 void setEnableDebugDraw(
bool enableDebugDraw);
49 void enableDebugDrawChanged(
bool enableDebugDraw);
50 void needsRebuild(QObject *);
53 bool m_scaleDirty =
true;
54 QVector3D m_prevScale;
57 void handleScaleChange();
60 bool m_enableDebugDraw =
false;
void createScene(float typicalLength, float typicalSpeed, const QVector3D &gravity, QPhysicsWorld *physicsWorld, unsigned int numThreads)
SimulationEventCallback * callback
physx::PxControllerManager * controllerManager
The QVector3D class represents a vector or vertex in 3D space.
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
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
unsigned int foundationRefCount
static StaticPhysXObjects & getReference()
physx::PxFoundation * foundation
physx::PxDefaultCpuDispatcher * dispatcher
physx::PxPhysics * physics