aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2020-05-04 17:42:22 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2020-06-09 12:09:41 +0000
commita3e6e24427ddfb2254becbbc60025a0eac04735c (patch)
tree015c1e4866b562a39e007f45aa3bcd1821478fb1 /share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h
parent4d23e6300f2525f9cc1483d79d8abe7938cbdea2 (diff)
QmlDesigner: Update light gizmos
Directional light model was made constant size, as it doesn't have actual physical presence. Spot light cone now shows the cone angle correctly and the length of the cone is calculated so that 5% of the brightness reaches the center of the cone bottom. Area light rectangle matches the area of the light. Point light mesh changed to three perpendicular circles. Same formula for size of the circles used as for spotlight length. All light types share a common brightness indicator arrow. Task-number: QDS-2037 Change-Id: I534dbcda9cfa2a7768c2537868ba83818979b250 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h
index 5614b3eb40..cac375d675 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/lightgeometry.h
@@ -28,7 +28,6 @@
#ifdef QUICK3D_MODULE
#include <QtQuick3D/private/qquick3dgeometry_p.h>
-#include <QtQuick3D/private/qquick3dabstractlight_p.h>
namespace QmlDesigner {
namespace Internal {
@@ -36,19 +35,28 @@ namespace Internal {
class LightGeometry : public QQuick3DGeometry
{
Q_OBJECT
- Q_PROPERTY(QQuick3DAbstractLight *light READ light WRITE setLight NOTIFY lightChanged)
+ Q_PROPERTY(LightType lightType READ lightType WRITE setLightType NOTIFY lightTypeChanged)
public:
+ enum class LightType {
+ Invalid,
+ Spot,
+ Area,
+ Directional,
+ Point
+ };
+ Q_ENUM(LightType)
+
LightGeometry();
~LightGeometry() override;
- QQuick3DAbstractLight *light() const;
+ LightType lightType() const;
public Q_SLOTS:
- void setLight(QQuick3DAbstractLight *light);
+ void setLightType(LightType lightType);
Q_SIGNALS:
- void lightChanged();
+ void lightTypeChanged();
protected:
QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
@@ -56,7 +64,7 @@ protected:
private:
void fillVertexData(QByteArray &vertexData, QByteArray &indexData,
QVector3D &minBounds, QVector3D &maxBounds);
- QQuick3DAbstractLight *m_light = nullptr;
+ LightType m_lightType = LightType::Invalid;
};
}