| 1 | // Copyright (C) 2019 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QSSGFRUSTUMCAMERA_H |
| 5 | #define QSSGFRUSTUMCAMERA_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtQuick3D/private/qquick3dperspectivecamera_p.h> |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | struct QSSGRenderCamera; |
| 23 | class Q_QUICK3D_EXPORT QQuick3DFrustumCamera : public QQuick3DPerspectiveCamera |
| 24 | { |
| 25 | Q_OBJECT |
| 26 | Q_PROPERTY(float top READ top WRITE setTop NOTIFY topChanged) |
| 27 | Q_PROPERTY(float bottom READ bottom WRITE setBottom NOTIFY bottomChanged) |
| 28 | Q_PROPERTY(float right READ right WRITE setRight NOTIFY rightChanged) |
| 29 | Q_PROPERTY(float left READ left WRITE setLeft NOTIFY leftChanged) |
| 30 | |
| 31 | QML_NAMED_ELEMENT(FrustumCamera) |
| 32 | |
| 33 | public: |
| 34 | explicit QQuick3DFrustumCamera(QQuick3DNode *parent = nullptr); |
| 35 | |
| 36 | float top() const; |
| 37 | float bottom() const; |
| 38 | float right() const; |
| 39 | float left() const; |
| 40 | |
| 41 | public Q_SLOTS: |
| 42 | void setTop(float top); |
| 43 | void setBottom(float bottom); |
| 44 | void setRight(float right); |
| 45 | void setLeft(float left); |
| 46 | |
| 47 | Q_SIGNALS: |
| 48 | void topChanged(); |
| 49 | void bottomChanged(); |
| 50 | void rightChanged(); |
| 51 | void leftChanged(); |
| 52 | |
| 53 | protected: |
| 54 | QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override; |
| 55 | |
| 56 | private: |
| 57 | float m_top = 0.0f; |
| 58 | float m_bottom = 0.0f; |
| 59 | float m_right = 0.0f; |
| 60 | float m_left = 0.0f; |
| 61 | }; |
| 62 | |
| 63 | QT_END_NAMESPACE |
| 64 | |
| 65 | #endif // QSSGFRUSTUMCAMERA_H |
| 66 | |