diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2017-05-04 13:00:16 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-05-05 04:47:57 +0000 |
commit | 043b8bc956eafcf63da88ef011e73bb5dbcc6683 (patch) | |
tree | e25ddb2c88413aece334d5b7619b2cc94991c1e6 /src/extras/geometries/qplanegeometry.h | |
parent | 6fd0fc4217fe689092957e0bad8a927acb4aa09a (diff) |
Add a new mirrored property to QPlane(Mesh|Geometry)
This is regularly necessary to be able to flip vertically the UV
coordinates on the plane mesh depending if we are using a texture in
model space coords or in window coords. Especially necessary now with
Scene2D which outputs textures in window coords. This property is
necessary to make it usable.
Change-Id: I0fe7d3fdc125f1791492cf39ebe908bbc20f1db2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/extras/geometries/qplanegeometry.h')
-rw-r--r-- | src/extras/geometries/qplanegeometry.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/extras/geometries/qplanegeometry.h b/src/extras/geometries/qplanegeometry.h index 694e04e82..4a4efe6eb 100644 --- a/src/extras/geometries/qplanegeometry.h +++ b/src/extras/geometries/qplanegeometry.h @@ -62,6 +62,7 @@ class QT3DEXTRASSHARED_EXPORT QPlaneGeometry : public Qt3DRender::QGeometry Q_PROPERTY(float width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(float height READ height WRITE setHeight NOTIFY heightChanged) Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged) + Q_PROPERTY(bool mirrored READ mirrored WRITE setMirrored NOTIFY mirroredChanged REVISION 9) Q_PROPERTY(Qt3DRender::QAttribute *positionAttribute READ positionAttribute CONSTANT) Q_PROPERTY(Qt3DRender::QAttribute *normalAttribute READ normalAttribute CONSTANT) Q_PROPERTY(Qt3DRender::QAttribute *texCoordAttribute READ texCoordAttribute CONSTANT) @@ -78,6 +79,7 @@ public: QSize resolution() const; float width() const; float height() const; + bool mirrored() const; Qt3DRender::QAttribute *positionAttribute() const; Qt3DRender::QAttribute *normalAttribute() const; @@ -89,11 +91,13 @@ public Q_SLOTS: void setResolution(const QSize &resolution); void setWidth(float width); void setHeight(float height); + void setMirrored(bool mirrored); Q_SIGNALS: void resolutionChanged(const QSize &resolution); void widthChanged(float width); void heightChanged(float height); + void mirroredChanged(bool mirrored); protected: QPlaneGeometry(QPlaneGeometryPrivate &dd, QNode *parent = nullptr); |