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 QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_H
5#define QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DRender/qmaterial.h>
9#include <QtGui/QColor>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DExtras {
14
15class QNormalDiffuseSpecularMapMaterialPrivate;
16
17class Q_3DEXTRASSHARED_EXPORT QNormalDiffuseSpecularMapMaterial : public Qt3DRender::QMaterial
18{
19 Q_OBJECT
20 Q_PROPERTY(QColor ambient READ ambient WRITE setAmbient NOTIFY ambientChanged)
21 Q_PROPERTY(Qt3DRender::QAbstractTexture *diffuse READ diffuse WRITE setDiffuse NOTIFY diffuseChanged)
22 Q_PROPERTY(Qt3DRender::QAbstractTexture *normal READ normal WRITE setNormal NOTIFY normalChanged)
23 Q_PROPERTY(Qt3DRender::QAbstractTexture *specular READ specular WRITE setSpecular NOTIFY specularChanged)
24 Q_PROPERTY(float shininess READ shininess WRITE setShininess NOTIFY shininessChanged)
25 Q_PROPERTY(float textureScale READ textureScale WRITE setTextureScale NOTIFY textureScaleChanged)
26
27public:
28 explicit QNormalDiffuseSpecularMapMaterial(Qt3DCore::QNode *parent = nullptr);
29 ~QNormalDiffuseSpecularMapMaterial();
30
31 QColor ambient() const;
32 Qt3DRender::QAbstractTexture *diffuse() const;
33 Qt3DRender::QAbstractTexture *normal() const;
34 Qt3DRender::QAbstractTexture *specular() const;
35 float shininess() const;
36 float textureScale() const;
37
38public Q_SLOTS:
39 void setAmbient(const QColor &ambient);
40 void setDiffuse(Qt3DRender::QAbstractTexture *diffuse);
41 void setNormal(Qt3DRender::QAbstractTexture *normal);
42 void setSpecular(Qt3DRender::QAbstractTexture *specular);
43 void setShininess(float shininess);
44 void setTextureScale(float textureScale);
45
46Q_SIGNALS:
47 void ambientChanged(const QColor &ambient);
48 void diffuseChanged(Qt3DRender::QAbstractTexture *diffuse);
49 void normalChanged(Qt3DRender::QAbstractTexture *normal);
50 void specularChanged(Qt3DRender::QAbstractTexture *specular);
51 void shininessChanged(float shininess);
52 void textureScaleChanged(float textureScale);
53
54protected:
55 QNormalDiffuseSpecularMapMaterial(QNormalDiffuseSpecularMapMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr);
56
57private:
58 Q_DECLARE_PRIVATE(QNormalDiffuseSpecularMapMaterial)
59};
60
61} // namespace Qt3DExtras
62
63QT_END_NAMESPACE
64
65#endif // QT3DEXTRAS_QNORMALDIFFUSESPECULARMAPMATERIAL_H
66

source code of qt3d/src/extras/defaults/qnormaldiffusespecularmapmaterial.h