summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/cylinder-cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-11-07 19:02:14 +0000
committerPaul Lemire <paul.lemire@kdab.com>2015-11-17 19:41:18 +0000
commit26a118cfbce29014864f6cdddae66cccb65ffb4f (patch)
treedaea9f2fc41c1df586c35cd56daa61f920ce5b58 /examples/qt3d/cylinder-cpp
parentace675a084ab944a245500b9f54be653126c3147 (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/cylinder-cpp')
-rw-r--r--examples/qt3d/cylinder-cpp/main.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/examples/qt3d/cylinder-cpp/main.cpp b/examples/qt3d/cylinder-cpp/main.cpp
index e65554f92..b6441314e 100644
--- a/examples/qt3d/cylinder-cpp/main.cpp
+++ b/examples/qt3d/cylinder-cpp/main.cpp
@@ -108,21 +108,14 @@ int main(int argc, char **argv)
cylinder->setSlices(20);
// CylinderMesh Transform
- Qt3DCore::QScaleTransform *cylinderScale = new Qt3DCore::QScaleTransform();
- Qt3DCore::QRotateTransform *cylinderRotation = new Qt3DCore::QRotateTransform();
- Qt3DCore::QTransform *cylinderTransforms = new Qt3DCore::QTransform();
-
- cylinderScale->setScale3D(QVector3D(1.5f, 1.5f, 1.5f));
- cylinderRotation->setAngleDeg(45.0f);
- cylinderRotation->setAxis(QVector3D(1, 0, 0));
-
- cylinderTransforms->addTransform(cylinderScale);
- cylinderTransforms->addTransform(cylinderRotation);
+ Qt3DCore::QTransform *cylinderTransform = new Qt3DCore::QTransform;
+ cylinderTransform->setScale(1.5f);
+ cylinderTransform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), 45.0f));
// Cylinder
Qt3DCore::QEntity *cylinderEntity = new Qt3DCore::QEntity(rootEntity);
cylinderEntity->addComponent(cylinder);
- cylinderEntity->addComponent(cylinderTransforms);
+ cylinderEntity->addComponent(cylinderTransform);
// Setting the FrameGraph
rootEntity->addComponent(frameGraph);