1// Copyright (C) 2014 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 QT3DRENDER_QPOINTLIGHT_H
5#define QT3DRENDER_QPOINTLIGHT_H
6
7#include <Qt3DRender/qabstractlight.h>
8
9QT_BEGIN_NAMESPACE
10
11namespace Qt3DRender {
12
13class QPointLightPrivate;
14
15class Q_3DRENDERSHARED_EXPORT QPointLight : public QAbstractLight
16{
17 Q_OBJECT
18 Q_PROPERTY(float constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged)
19 Q_PROPERTY(float linearAttenuation READ linearAttenuation WRITE setLinearAttenuation NOTIFY linearAttenuationChanged)
20 Q_PROPERTY(float quadraticAttenuation READ quadraticAttenuation WRITE setQuadraticAttenuation NOTIFY quadraticAttenuationChanged)
21
22public:
23 explicit QPointLight(Qt3DCore::QNode *parent = nullptr);
24 ~QPointLight();
25
26 float constantAttenuation() const;
27 float linearAttenuation() const;
28 float quadraticAttenuation() const;
29
30public Q_SLOTS:
31 void setConstantAttenuation(float value);
32 void setLinearAttenuation(float value);
33 void setQuadraticAttenuation(float value);
34
35Q_SIGNALS:
36 void constantAttenuationChanged(float constantAttenuation);
37 void linearAttenuationChanged(float linearAttenuation);
38 void quadraticAttenuationChanged(float quadraticAttenuation);
39
40protected:
41 Q_DECLARE_PRIVATE(QPointLight)
42 QPointLight(QPointLightPrivate &dd, Qt3DCore::QNode *parent);
43};
44
45} // namespace Qt3DRender
46
47QT_END_NAMESPACE
48
49#endif // QT3DRENDER_QPOINTLIGHT_H
50

source code of qt3d/src/render/lights/qpointlight.h