| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). | 
| 4 | ** Contact: http://www.qt-project.org/legal | 
| 5 | ** | 
| 6 | ** This file is part of the Qt3D module of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:LGPL3$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at http://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU Lesser General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
| 19 | ** General Public License version 3 as published by the Free Software | 
| 20 | ** Foundation and appearing in the file LICENSE.LGPLv3 included in the | 
| 21 | ** packaging of this file. Please review the following information to | 
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | 
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl.html. | 
| 24 | ** | 
| 25 | ** GNU General Public License Usage | 
| 26 | ** Alternatively, this file may be used under the terms of the GNU | 
| 27 | ** General Public License version 2.0 or later as published by the Free | 
| 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in | 
| 29 | ** the packaging of this file. Please review the following information to | 
| 30 | ** ensure the GNU General Public License version 2.0 requirements will be | 
| 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. | 
| 32 | ** | 
| 33 | ** $QT_END_LICENSE$ | 
| 34 | ** | 
| 35 | ****************************************************************************/ | 
| 36 |  | 
| 37 | #ifndef QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H | 
| 38 | #define  | 
| 39 |  | 
| 40 | #include <Qt3DCore/QEntity> | 
| 41 | #include <Qt3DExtras/qt3dextras_global.h> | 
| 42 |  | 
| 43 | QT_BEGIN_NAMESPACE | 
| 44 |  | 
| 45 | namespace Qt3DInput { | 
| 46 | class QKeyboardDevice; | 
| 47 | class QMouseDevice; | 
| 48 | } | 
| 49 |  | 
| 50 | namespace Qt3DRender { | 
| 51 | class QCamera; | 
| 52 | } | 
| 53 |  | 
| 54 | namespace Qt3DExtras { | 
| 55 |  | 
| 56 | class ; | 
| 57 |  | 
| 58 | class Q_3DEXTRASSHARED_EXPORT  : public Qt3DCore::QEntity | 
| 59 | { | 
| 60 |     Q_OBJECT | 
| 61 |     Q_PROPERTY(Qt3DRender::QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged) | 
| 62 |     Q_PROPERTY(float linearSpeed READ linearSpeed WRITE setLinearSpeed NOTIFY linearSpeedChanged) | 
| 63 |     Q_PROPERTY(float lookSpeed READ lookSpeed WRITE setLookSpeed NOTIFY lookSpeedChanged) | 
| 64 |     Q_PROPERTY(float acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged) | 
| 65 |     Q_PROPERTY(float deceleration READ deceleration WRITE setDeceleration NOTIFY decelerationChanged) | 
| 66 |  | 
| 67 | public: | 
| 68 |     (); | 
| 69 |  | 
| 70 |     Qt3DRender::QCamera *() const; | 
| 71 |     float () const; | 
| 72 |     float () const; | 
| 73 |  | 
| 74 |     float () const; | 
| 75 |     float () const; | 
| 76 |  | 
| 77 |     void (Qt3DRender::QCamera *camera); | 
| 78 |     void (float linearSpeed); | 
| 79 |     void (float lookSpeed); | 
| 80 |  | 
| 81 |     void (float acceleration); | 
| 82 |     void (float deceleration); | 
| 83 |  | 
| 84 | Q_SIGNALS: | 
| 85 |     void (); | 
| 86 |     void (); | 
| 87 |     void (); | 
| 88 |  | 
| 89 |     void (float acceleration); | 
| 90 |     void (float deceleration); | 
| 91 |  | 
| 92 | protected: | 
| 93 |     explicit (Qt3DCore::QNode *parent = nullptr); | 
| 94 |     (QAbstractCameraControllerPrivate &dd, Qt3DCore::QNode *parent = nullptr); | 
| 95 |  | 
| 96 |     Qt3DInput::QKeyboardDevice *() const; | 
| 97 |     Qt3DInput::QMouseDevice *() const; | 
| 98 |  | 
| 99 | public: | 
| 100 |     struct  | 
| 101 |     { | 
| 102 |         float ; | 
| 103 |         float ; | 
| 104 |         float ; | 
| 105 |         float ; | 
| 106 |         float ; | 
| 107 |  | 
| 108 |         bool ; | 
| 109 |         bool ; | 
| 110 |         bool ; | 
| 111 |  | 
| 112 |         bool ; | 
| 113 |         bool ; | 
| 114 |     }; | 
| 115 |  | 
| 116 | private: | 
| 117 |     virtual void (const InputState &state, float dt) = 0; | 
| 118 |  | 
| 119 | private: | 
| 120 |     Q_DECLARE_PRIVATE(QAbstractCameraController) | 
| 121 | }; | 
| 122 |  | 
| 123 | }   // Qt3DExtras | 
| 124 |  | 
| 125 | QT_END_NAMESPACE | 
| 126 |  | 
| 127 | #endif // QT3DEXTRAS_QABSTRACTCAMERACONTROLLER_H | 
| 128 |  |