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
qquick3dspotlight_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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
6#ifndef QQUICK3DSPOTLIGHT_H
7#define QQUICK3DSPOTLIGHT_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/private/qquick3dabstractlight_p.h>
21
23
24class Q_QUICK3D_EXPORT QQuick3DSpotLight : public QQuick3DAbstractLight
25{
26 Q_OBJECT
27 Q_PROPERTY(float constantFade READ constantFade WRITE setConstantFade NOTIFY constantFadeChanged)
28 Q_PROPERTY(float linearFade READ linearFade WRITE setLinearFade NOTIFY linearFadeChanged)
29 Q_PROPERTY(float quadraticFade READ quadraticFade WRITE setQuadraticFade NOTIFY quadraticFadeChanged)
30 Q_PROPERTY(float coneAngle READ coneAngle WRITE setConeAngle NOTIFY coneAngleChanged)
31 Q_PROPERTY(float innerConeAngle READ innerConeAngle WRITE setInnerConeAngle NOTIFY innerConeAngleChanged)
32
33 QML_NAMED_ELEMENT(SpotLight)
34
35public:
36 explicit QQuick3DSpotLight(QQuick3DNode *parent = nullptr);
37 ~QQuick3DSpotLight() override {}
38
39 float constantFade() const;
40 float linearFade() const;
41 float quadraticFade() const;
42 float coneAngle() const;
43 float innerConeAngle() const;
44
45public Q_SLOTS:
46 void setConstantFade(float constantFade);
47 void setLinearFade(float linearFade);
48 void setQuadraticFade(float quadraticFade);
49 void setConeAngle(float coneAngle);
50 void setInnerConeAngle(float innerConeAngle);
51
52Q_SIGNALS:
53 void constantFadeChanged();
54 void linearFadeChanged();
55 void quadraticFadeChanged();
56 void coneAngleChanged();
57 void innerConeAngleChanged();
58
59protected:
60 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
61
62private:
63 float m_constantFade = 1.0f;
64 float m_linearFade = 0.0f;
65 float m_quadraticFade = 1.0f;
66 float m_coneAngle = 40.0f;
67 float m_innerConeAngle = 30.0f;
68};
69
70QT_END_NAMESPACE
71
72#endif // QQUICK3DSPOTLIGHT_H
Combined button and popup list for selecting options.