| 1 | // Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H |
| 5 | #define |
| 6 | |
| 7 | #include <Qt3DCore/QEntity> |
| 8 | #include <Qt3DExtras/qt3dextras_global.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | namespace Qt3DInput { |
| 13 | class QKeyboardDevice; |
| 14 | class QMouseDevice; |
| 15 | } |
| 16 | |
| 17 | namespace Qt3DRender { |
| 18 | class QCamera; |
| 19 | } |
| 20 | |
| 21 | namespace Qt3DExtras { |
| 22 | |
| 23 | class ; |
| 24 | |
| 25 | class Q_3DEXTRASSHARED_EXPORT : public Qt3DCore::QEntity |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | Q_PROPERTY(Qt3DRender::QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged) |
| 29 | Q_PROPERTY(float linearSpeed READ linearSpeed WRITE setLinearSpeed NOTIFY linearSpeedChanged) |
| 30 | Q_PROPERTY(float lookSpeed READ lookSpeed WRITE setLookSpeed NOTIFY lookSpeedChanged) |
| 31 | Q_PROPERTY(float acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged) |
| 32 | Q_PROPERTY(float deceleration READ deceleration WRITE setDeceleration NOTIFY decelerationChanged) |
| 33 | |
| 34 | public: |
| 35 | (); |
| 36 | |
| 37 | Qt3DRender::QCamera *() const; |
| 38 | float () const; |
| 39 | float () const; |
| 40 | |
| 41 | float () const; |
| 42 | float () const; |
| 43 | |
| 44 | void (Qt3DRender::QCamera *camera); |
| 45 | void (float linearSpeed); |
| 46 | void (float lookSpeed); |
| 47 | |
| 48 | void (float acceleration); |
| 49 | void (float deceleration); |
| 50 | |
| 51 | Q_SIGNALS: |
| 52 | void (); |
| 53 | void (); |
| 54 | void (); |
| 55 | |
| 56 | void (float acceleration); |
| 57 | void (float deceleration); |
| 58 | |
| 59 | protected: |
| 60 | explicit (Qt3DCore::QNode *parent = nullptr); |
| 61 | (QAbstractCameraControllerPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
| 62 | |
| 63 | Qt3DInput::QKeyboardDevice *() const; |
| 64 | Qt3DInput::QMouseDevice *() const; |
| 65 | |
| 66 | public: |
| 67 | struct |
| 68 | { |
| 69 | float ; |
| 70 | float ; |
| 71 | float ; |
| 72 | float ; |
| 73 | float ; |
| 74 | |
| 75 | bool ; |
| 76 | bool ; |
| 77 | bool ; |
| 78 | |
| 79 | bool ; |
| 80 | bool ; |
| 81 | }; |
| 82 | |
| 83 | private: |
| 84 | virtual void (const InputState &state, float dt) = 0; |
| 85 | |
| 86 | private: |
| 87 | Q_DECLARE_PRIVATE(QAbstractCameraController) |
| 88 | }; |
| 89 | |
| 90 | } // Qt3DExtras |
| 91 | |
| 92 | QT_END_NAMESPACE |
| 93 | |
| 94 | #endif // QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H |
| 95 | |