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
qcapsuleshape_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 CAPSULESHAPE_H
6#define CAPSULESHAPE_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 <QtQuick3DPhysics/private/qabstractcollisionshape_p.h>
21#include <QtQml/QQmlEngine>
22
23namespace physx {
24class PxCapsuleGeometry;
25}
26
28
29class Q_QUICK3DPHYSICS_EXPORT QCapsuleShape : public QAbstractCollisionShape
30{
31 Q_OBJECT
32 QML_NAMED_ELEMENT(CapsuleShape)
33 Q_PROPERTY(float diameter READ diameter WRITE setDiameter NOTIFY diameterChanged)
34 Q_PROPERTY(float height READ height WRITE setHeight NOTIFY heightChanged)
35public:
36 QCapsuleShape();
37 ~QCapsuleShape();
38
39 float diameter() const;
40 void setDiameter(float newDiameter);
41
42 float height() const;
43 void setHeight(float newHeight);
44
45 physx::PxGeometry *getPhysXGeometry() override;
46 bool isStaticShape() const override { return false; }
47
48Q_SIGNALS:
49 void diameterChanged();
50 void heightChanged();
51
52private:
53 void updatePhysXGeometry();
54 physx::PxCapsuleGeometry *m_physXGeometry = nullptr;
55 float m_diameter = 100.0f;
56 float m_height = 100.0f;
57};
58
60
61#endif // CAPSULESHAPE_H
virtual void cleanup(QPhysXWorld *)
void createMaterialFromQtMaterial(QPhysXWorld *physX, QPhysicsMaterial *qtMaterial)
QPhysXCharacterController(QCharacterController *frontEnd)
DebugDrawBodyType getDebugDrawBodyType() override
void init(QPhysicsWorld *world, QPhysXWorld *physX) override
void cleanup(QPhysXWorld *physX) override
void createMaterial(QPhysXWorld *physX) override
void sync(float deltaTime, QHash< QQuick3DNode *, QMatrix4x4 > &transformCache) override
#define PHYSX_RELEASE(x)
DebugDrawBodyType
#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE