diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-11-07 19:02:14 +0000 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-11-17 19:41:18 +0000 |
commit | 26a118cfbce29014864f6cdddae66cccb65ffb4f (patch) | |
tree | daea9f2fc41c1df586c35cd56daa61f920ce5b58 /examples/qt3d/materials/RenderableEntity.qml | |
parent | ace675a084ab944a245500b9f54be653126c3147 (diff) |
Remove transforms property of QTransform
Compound transformations are now built up using QMatrix4x4 in both QML
and C++. Updating examples accordingly.
Change-Id: I03c9abf1f6cdd1b56226dc0e16a7ad5ce84516dd
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/materials/RenderableEntity.qml')
-rw-r--r-- | examples/qt3d/materials/RenderableEntity.qml | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/examples/qt3d/materials/RenderableEntity.qml b/examples/qt3d/materials/RenderableEntity.qml index 093ba24e5..e309ec8ba 100644 --- a/examples/qt3d/materials/RenderableEntity.qml +++ b/examples/qt3d/materials/RenderableEntity.qml @@ -40,12 +40,10 @@ import Qt3D.Render 2.0 Entity { id: root - property alias x: translateTransform.dx - property alias y: translateTransform.dy - property alias z: translateTransform.dz - property alias scale: scaleTransform.scale - property alias rotationAngle: rotateTransform.angle - property alias rotationAxis: rotateTransform.axis + property vector3d position: Qt.vector3d(0, 0, 0) + property real scale: 1.0 + property real rotationAngle: 0.0 + property vector3d rotationAxis: Qt.vector3d(1, 0, 0) property alias source: mesh.source property Material material @@ -53,9 +51,16 @@ Entity { Transform { id: transform - Rotate { id: rotateTransform } - Scale { id: scaleTransform } - Translate { id: translateTransform } + matrix: { + var m = Qt.matrix4x4(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + m.translate(root.position); + m.rotate(root.rotationAngle, root.rotationAxis); + m.scale(root.scale); + return m; + } } Mesh { |