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/assimp/main.cpp | |
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/assimp/main.cpp')
-rw-r--r-- | examples/qt3d/assimp/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/qt3d/assimp/main.cpp b/examples/qt3d/assimp/main.cpp index f0b8b6fbc..a637d47ae 100644 --- a/examples/qt3d/assimp/main.cpp +++ b/examples/qt3d/assimp/main.cpp @@ -50,6 +50,7 @@ class SceneHelper : public QObject public: Q_INVOKABLE QObject *findEntity(Qt3DRender::QSceneLoader *loader, const QString &name); + Q_INVOKABLE QObject *findComponent(Qt3DCore::QEntity *entity, const QString &componentMetatype); Q_INVOKABLE void addListEntry(const QVariant &list, QObject *entry); }; @@ -70,6 +71,19 @@ QObject *SceneHelper::findEntity(Qt3DRender::QSceneLoader *loader, const QString return root->findChild<Qt3DCore::QEntity *>(name); } +QObject *SceneHelper::findComponent(Qt3DCore::QEntity *entity, const QString &componentMetatype) +{ + Q_ASSERT(entity); + Qt3DCore::QComponentList components = entity->components(); + Q_FOREACH (Qt3DCore::QComponent *component, components) { + qDebug() << component->metaObject()->className(); + if (component->metaObject()->className() == componentMetatype) { + return component; + } + } + return Q_NULLPTR; +} + void SceneHelper::addListEntry(const QVariant &list, QObject *entry) { QQmlListReference ref = list.value<QQmlListReference>(); |