summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-01-20 15:16:21 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2015-01-23 07:51:29 +0100
commitae03c0af3b07712f6a5a1c75fe729215ea820d54 (patch)
treeed9d117f4a384c1f3a113b47347c16d0c4537c01 /examples
parentf901090a4144d64bd8b483b75af3af4fd7142b45 (diff)
Move CameraController in the input aspect
With this move it also becomes a private class. As a result I had to touch all the examples as you won't get camera navigation anymore if the input aspect is not registered. Quick3DConfiguration doesn't depend on the QuickWindow singleton hack anymore, it tries to get back to the aspects and set the camera on the ones having a corresponding property. It also mostly empties Window and QuickWindow. Change-Id: Ife1644bd338e51929bad1e99089bd5e4c68ebc68 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/assimp/assimp.pro2
-rw-r--r--examples/assimp/main.cpp2
-rw-r--r--examples/bigmodel-qml/bigmodel-qml.pro2
-rw-r--r--examples/bigmodel-qml/main.cpp2
-rw-r--r--examples/bigscene-cpp/bigscene-cpp.pro2
-rw-r--r--examples/bigscene-cpp/main.cpp5
-rw-r--r--examples/cpp_example/cpp_example.pro2
-rw-r--r--examples/cpp_example/main.cpp6
-rw-r--r--examples/cylinder-cpp/cylinder-cpp.pro2
-rw-r--r--examples/cylinder-cpp/main.cpp6
-rw-r--r--examples/cylinder-qml/cylinder-qml.pro2
-rw-r--r--examples/cylinder-qml/main.cpp3
-rw-r--r--examples/deferred-renderer-cpp/deferred-renderer-cpp.pro2
-rw-r--r--examples/deferred-renderer-cpp/main.cpp7
-rw-r--r--examples/deferred-renderer-qml/deferred-renderer-qml.pro2
-rw-r--r--examples/deferred-renderer-qml/main.cpp2
-rw-r--r--examples/dynamicscene-cpp/dynamicscene-cpp.pro2
-rw-r--r--examples/dynamicscene-cpp/main.cpp6
-rw-r--r--examples/gltf/gltf.pro2
-rw-r--r--examples/gltf/main.cpp2
-rw-r--r--examples/loader-qml/loader-qml.pro2
-rw-r--r--examples/loader-qml/main.cpp2
-rw-r--r--examples/materials-cpp/main.cpp6
-rw-r--r--examples/materials-cpp/materials-cpp.pro2
-rw-r--r--examples/materials/main.cpp2
-rw-r--r--examples/materials/materials.pro2
-rw-r--r--examples/multiviewport/main.cpp2
-rw-r--r--examples/multiviewport/multiviewport.pro2
-rw-r--r--examples/rollerball/main.cpp2
-rw-r--r--examples/rollerball/rollerball.pro2
-rw-r--r--examples/shadow-map-qml/main.cpp2
-rw-r--r--examples/shadow-map-qml/shadow-map-qml.pro2
-rw-r--r--examples/simple-cpp/main.cpp6
-rw-r--r--examples/simple-cpp/simple-cpp.pro2
-rw-r--r--examples/simple-qml/main.cpp2
-rw-r--r--examples/simple-qml/simple-qml.pro2
-rw-r--r--examples/tessellation-modes/main.cpp2
-rw-r--r--examples/tessellation-modes/tessellation-modes.pro2
-rw-r--r--examples/torus-cpp/main.cpp6
-rw-r--r--examples/torus-cpp/torus-cpp.pro2
-rw-r--r--examples/torus-qml/main.cpp3
-rw-r--r--examples/torus-qml/torus-qml.pro2
-rw-r--r--examples/wireframe/main.cpp2
-rw-r--r--examples/wireframe/wireframe.pro2
44 files changed, 90 insertions, 32 deletions
diff --git a/examples/assimp/assimp.pro b/examples/assimp/assimp.pro
index e2871ca80..1db64789d 100644
--- a/examples/assimp/assimp.pro
+++ b/examples/assimp/assimp.pro
@@ -2,7 +2,7 @@ TEMPLATE = app
SOURCE += main.cpp
-QT += qml quick 3dcore 3drenderer 3dquick
+QT += qml quick 3dcore 3drenderer 3dinput 3dquick
OTHER_FILES += main.qml
diff --git a/examples/assimp/main.cpp b/examples/assimp/main.cpp
index 4a73f8821..a2e864437 100644
--- a/examples/assimp/main.cpp
+++ b/examples/assimp/main.cpp
@@ -43,6 +43,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QtQml>
@@ -57,6 +58,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
data.insert(QStringLiteral("window"), QVariant::fromValue(&view));
diff --git a/examples/bigmodel-qml/bigmodel-qml.pro b/examples/bigmodel-qml/bigmodel-qml.pro
index 76b9b972d..e0535a346 100644
--- a/examples/bigmodel-qml/bigmodel-qml.pro
+++ b/examples/bigmodel-qml/bigmodel-qml.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
main.cpp
diff --git a/examples/bigmodel-qml/main.cpp b/examples/bigmodel-qml/main.cpp
index e7baa1bf2..f912f4cc6 100644
--- a/examples/bigmodel-qml/main.cpp
+++ b/examples/bigmodel-qml/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QtQml>
@@ -65,6 +66,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.qmlEngine()->rootContext()->setContextProperty("_meshFileNames", meshFileNames);
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/bigscene-cpp/bigscene-cpp.pro b/examples/bigscene-cpp/bigscene-cpp.pro
index 62853b0db..d95efa7a1 100644
--- a/examples/bigscene-cpp/bigscene-cpp.pro
+++ b/examples/bigscene-cpp/bigscene-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
SOURCES += \
main.cpp
diff --git a/examples/bigscene-cpp/main.cpp b/examples/bigscene-cpp/main.cpp
index 64a6b790b..e90a10b15 100644
--- a/examples/bigscene-cpp/main.cpp
+++ b/examples/bigscene-cpp/main.cpp
@@ -51,6 +51,7 @@
#include <Qt3DCore/QRotateTransform>
#include <Qt3DCore/QScaleTransform>
#include <Qt3DCore/qaspectengine.h>
+#include <Qt3DInput/QInputAspect>
#include <Qt3DRenderer/QParameter>
#include <Qt3DRenderer/QFrameGraph>
#include <Qt3DRenderer/QCylinderMesh>
@@ -69,6 +70,8 @@ int main(int ac, char **av)
Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -83,7 +86,7 @@ int main(int ac, char **av)
cameraEntity->setPosition(QVector3D(0, -250.0f, -50.0f));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
QFrameGraph *frameGraph = new QFrameGraph();
diff --git a/examples/cpp_example/cpp_example.pro b/examples/cpp_example/cpp_example.pro
index 8bdaaf170..943f81533 100644
--- a/examples/cpp_example/cpp_example.pro
+++ b/examples/cpp_example/cpp_example.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
include("../exampleresources/exampleresources.pri")
diff --git a/examples/cpp_example/main.cpp b/examples/cpp_example/main.cpp
index e36a93513..197b101ec 100644
--- a/examples/cpp_example/main.cpp
+++ b/examples/cpp_example/main.cpp
@@ -49,6 +49,8 @@
#include <Qt3DCore/qcameralens.h>
#include <Qt3DCore/qaspectengine.h>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/qtorusmesh.h>
#include <Qt3DRenderer/qmesh.h>
#include <Qt3DRenderer/qtechnique.h>
@@ -81,6 +83,8 @@ int main(int ac, char **av)
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -135,7 +139,7 @@ int main(int ac, char **av)
cameraEntity->setPosition(QVector3D(-5, 0, -20.0f));
cameraEntity->setViewCenter(QVector3D(11, 0, 5));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph();
diff --git a/examples/cylinder-cpp/cylinder-cpp.pro b/examples/cylinder-cpp/cylinder-cpp.pro
index 2bee5ff07..5ad940ff1 100644
--- a/examples/cylinder-cpp/cylinder-cpp.pro
+++ b/examples/cylinder-cpp/cylinder-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
SOURCES += main.cpp
diff --git a/examples/cylinder-cpp/main.cpp b/examples/cylinder-cpp/main.cpp
index edc5e45d9..2eaf4931d 100644
--- a/examples/cylinder-cpp/main.cpp
+++ b/examples/cylinder-cpp/main.cpp
@@ -46,6 +46,8 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qcameralens.h>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/qcylindermesh.h>
#include <Qt3DRenderer/qmesh.h>
#include <Qt3DRenderer/qtechnique.h>
@@ -71,6 +73,8 @@ int main(int argc, char **argv)
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -88,7 +92,7 @@ int main(int argc, char **argv)
cameraEntity->setPosition(QVector3D(0, 0, -20.0f));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph();
diff --git a/examples/cylinder-qml/cylinder-qml.pro b/examples/cylinder-qml/cylinder-qml.pro
index 85392449b..218ab62b5 100644
--- a/examples/cylinder-qml/cylinder-qml.pro
+++ b/examples/cylinder-qml/cylinder-qml.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
main.cpp
diff --git a/examples/cylinder-qml/main.cpp b/examples/cylinder-qml/main.cpp
index bee96cb2f..8b7d5c2f4 100644
--- a/examples/cylinder-qml/main.cpp
+++ b/examples/cylinder-qml/main.cpp
@@ -41,7 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
-
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QtQml>
@@ -54,6 +54,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/deferred-renderer-cpp/deferred-renderer-cpp.pro b/examples/deferred-renderer-cpp/deferred-renderer-cpp.pro
index 8fc5d682c..eaebea4ed 100644
--- a/examples/deferred-renderer-cpp/deferred-renderer-cpp.pro
+++ b/examples/deferred-renderer-cpp/deferred-renderer-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
include("../exampleresources/exampleresources.pri")
diff --git a/examples/deferred-renderer-cpp/main.cpp b/examples/deferred-renderer-cpp/main.cpp
index 4fc7c24b3..62732d25b 100644
--- a/examples/deferred-renderer-cpp/main.cpp
+++ b/examples/deferred-renderer-cpp/main.cpp
@@ -41,6 +41,9 @@
#include <Qt3DCore/QEntity>
#include <Qt3DCore/Window>
+
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/QRenderAspect>
#include <Qt3DRenderer/QFrameGraph>
#include <Qt3DRenderer/QMaterial>
@@ -72,6 +75,8 @@ int main(int ac, char **av)
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -121,7 +126,7 @@ int main(int ac, char **av)
camera->setUpVector(QVector3D(0.0f, 1.0f, 0.0f));
camera->setViewCenter(QVector3D(0.0f, 0.0f, 10.0f));
- view.setCamera(camera);
+ input->setCamera(camera);
// FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph();
diff --git a/examples/deferred-renderer-qml/deferred-renderer-qml.pro b/examples/deferred-renderer-qml/deferred-renderer-qml.pro
index f31398e22..2b1329c2e 100644
--- a/examples/deferred-renderer-qml/deferred-renderer-qml.pro
+++ b/examples/deferred-renderer-qml/deferred-renderer-qml.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/deferred-renderer-qml/main.cpp b/examples/deferred-renderer-qml/main.cpp
index 0408188e9..371ca9cb2 100644
--- a/examples/deferred-renderer-qml/main.cpp
+++ b/examples/deferred-renderer-qml/main.cpp
@@ -42,6 +42,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <exampleresources.h>
@@ -58,6 +59,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/dynamicscene-cpp/dynamicscene-cpp.pro b/examples/dynamicscene-cpp/dynamicscene-cpp.pro
index b67888946..715460121 100644
--- a/examples/dynamicscene-cpp/dynamicscene-cpp.pro
+++ b/examples/dynamicscene-cpp/dynamicscene-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
include("../exampleresources/exampleresources.pri")
diff --git a/examples/dynamicscene-cpp/main.cpp b/examples/dynamicscene-cpp/main.cpp
index abc67732f..aee718524 100644
--- a/examples/dynamicscene-cpp/main.cpp
+++ b/examples/dynamicscene-cpp/main.cpp
@@ -45,6 +45,8 @@
#include <Qt3DCore/QCamera>
#include <Qt3DCore/Window>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/QRenderAspect>
#include <Qt3DRenderer/QFrameGraph>
#include <Qt3DRenderer/QForwardRenderer>
@@ -59,6 +61,8 @@ int main(int argc, char* argv[])
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -75,7 +79,7 @@ int main(int argc, char* argv[])
basicCamera->setViewCenter(QVector3D(0.0f, 3.5f, 0.0f));
basicCamera->setPosition(QVector3D(0.0f, 3.5f, 25.0f));
// For camera controls
- view.setCamera(basicCamera);
+ input->setCamera(basicCamera);
// Forward Renderer FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph(sceneRoot);
diff --git a/examples/gltf/gltf.pro b/examples/gltf/gltf.pro
index 5a1dde26d..d2ac810a9 100644
--- a/examples/gltf/gltf.pro
+++ b/examples/gltf/gltf.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/gltf/main.cpp b/examples/gltf/main.cpp
index c80add25e..00dac1331 100644
--- a/examples/gltf/main.cpp
+++ b/examples/gltf/main.cpp
@@ -42,6 +42,7 @@
#include <exampleresources.h>
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QtQml>
@@ -56,6 +57,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/loader-qml/loader-qml.pro b/examples/loader-qml/loader-qml.pro
index d54671248..c4f4b38cf 100644
--- a/examples/loader-qml/loader-qml.pro
+++ b/examples/loader-qml/loader-qml.pro
@@ -1,5 +1,5 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
main.cpp
diff --git a/examples/loader-qml/main.cpp b/examples/loader-qml/main.cpp
index a9d5d101d..3488ffa52 100644
--- a/examples/loader-qml/main.cpp
+++ b/examples/loader-qml/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
@@ -52,6 +53,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/materials-cpp/main.cpp b/examples/materials-cpp/main.cpp
index eee06f22b..3a84c33f7 100644
--- a/examples/materials-cpp/main.cpp
+++ b/examples/materials-cpp/main.cpp
@@ -46,6 +46,8 @@
#include <Qt3DCore/QAspectEngine>
#include <Qt3DCore/QCamera>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/QRenderAspect>
#include <Qt3DRenderer/QPhongMaterial>
#include <Qt3DRenderer/QDiffuseMapMaterial>
@@ -66,6 +68,8 @@ int main(int argc, char* argv[])
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -83,7 +87,7 @@ int main(int argc, char* argv[])
basicCamera->setViewCenter(QVector3D(0.0f, 3.5f, 0.0f));
basicCamera->setPosition(QVector3D(0.0f, 3.5f, 25.0f));
// For camera controls
- view.setCamera(basicCamera);
+ input->setCamera(basicCamera);
// Forward Renderer FrameGraph
Qt3D::QFrameGraph *frameGraphComponent = new Qt3D::QFrameGraph(sceneRoot);
diff --git a/examples/materials-cpp/materials-cpp.pro b/examples/materials-cpp/materials-cpp.pro
index bc32d5491..351ed82f8 100644
--- a/examples/materials-cpp/materials-cpp.pro
+++ b/examples/materials-cpp/materials-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
include("../exampleresources/exampleresources.pri")
diff --git a/examples/materials/main.cpp b/examples/materials/main.cpp
index 068b475f0..3adf1e08d 100644
--- a/examples/materials/main.cpp
+++ b/examples/materials/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <exampleresources.h>
@@ -57,6 +58,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/materials/materials.pro b/examples/materials/materials.pro
index d87485513..23d4d38a8 100644
--- a/examples/materials/materials.pro
+++ b/examples/materials/materials.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/multiviewport/main.cpp b/examples/multiviewport/main.cpp
index 0d003cdb8..d332c2e7b 100644
--- a/examples/multiviewport/main.cpp
+++ b/examples/multiviewport/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <exampleresources.h>
@@ -54,6 +55,7 @@ int main(int ac, char **av)
initializeAssetResources("../exampleresources/example-assets.qrb");
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect);
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
data.insert(QStringLiteral("window"), QVariant::fromValue(&view));
diff --git a/examples/multiviewport/multiviewport.pro b/examples/multiviewport/multiviewport.pro
index 237c4bbbb..d7ed38b6d 100644
--- a/examples/multiviewport/multiviewport.pro
+++ b/examples/multiviewport/multiviewport.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/rollerball/main.cpp b/examples/rollerball/main.cpp
index f8efd86cf..89b32c4fe 100644
--- a/examples/rollerball/main.cpp
+++ b/examples/rollerball/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <Qt3DBulletPhysics/bulletphysicsaspect.h>
#include <exampleresources.h>
@@ -58,6 +59,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->registerAspect(new Qt3D::BulletPhysicsAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/rollerball/rollerball.pro b/examples/rollerball/rollerball.pro
index e7c906f97..601b3811f 100644
--- a/examples/rollerball/rollerball.pro
+++ b/examples/rollerball/rollerball.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dbulletphysics 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dbulletphysics 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/shadow-map-qml/main.cpp b/examples/shadow-map-qml/main.cpp
index 2e70ba22b..886dfe35a 100644
--- a/examples/shadow-map-qml/main.cpp
+++ b/examples/shadow-map-qml/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QQmlContext>
@@ -59,6 +60,7 @@ int main(int argc, char* argv[])
view.resize(1600, 800);
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/shadow-map-qml/shadow-map-qml.pro b/examples/shadow-map-qml/shadow-map-qml.pro
index 5d7467f5a..7d7670022 100644
--- a/examples/shadow-map-qml/shadow-map-qml.pro
+++ b/examples/shadow-map-qml/shadow-map-qml.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/simple-cpp/main.cpp b/examples/simple-cpp/main.cpp
index 720308d68..4f1fab7fc 100644
--- a/examples/simple-cpp/main.cpp
+++ b/examples/simple-cpp/main.cpp
@@ -52,6 +52,8 @@
#include <Qt3DCore/QTranslateTransform>
#include <Qt3DCore/QAspectEngine>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/QRenderAspect>
#include <Qt3DRenderer/QFrameGraph>
#include <Qt3DRenderer/QForwardRenderer>
@@ -70,6 +72,8 @@ int main(int argc, char* argv[])
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -87,7 +91,7 @@ int main(int argc, char* argv[])
cameraEntity->setPosition(QVector3D(0, 0, -40.0f));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
diff --git a/examples/simple-cpp/simple-cpp.pro b/examples/simple-cpp/simple-cpp.pro
index 9bf36fff7..c7f008ae9 100644
--- a/examples/simple-cpp/simple-cpp.pro
+++ b/examples/simple-cpp/simple-cpp.pro
@@ -1,5 +1,5 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
SOURCES += \
main.cpp
diff --git a/examples/simple-qml/main.cpp b/examples/simple-qml/main.cpp
index a9d5d101d..3488ffa52 100644
--- a/examples/simple-qml/main.cpp
+++ b/examples/simple-qml/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
@@ -52,6 +53,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
engine.aspectEngine()->initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/simple-qml/simple-qml.pro b/examples/simple-qml/simple-qml.pro
index b5fdfffe7..0df3ee3e6 100644
--- a/examples/simple-qml/simple-qml.pro
+++ b/examples/simple-qml/simple-qml.pro
@@ -1,5 +1,5 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
main.cpp
diff --git a/examples/tessellation-modes/main.cpp b/examples/tessellation-modes/main.cpp
index 93c006e02..7b503356a 100644
--- a/examples/tessellation-modes/main.cpp
+++ b/examples/tessellation-modes/main.cpp
@@ -43,6 +43,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <exampleresources.h>
@@ -59,6 +60,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
diff --git a/examples/tessellation-modes/tessellation-modes.pro b/examples/tessellation-modes/tessellation-modes.pro
index b95545243..683dd7f9f 100644
--- a/examples/tessellation-modes/tessellation-modes.pro
+++ b/examples/tessellation-modes/tessellation-modes.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")
diff --git a/examples/torus-cpp/main.cpp b/examples/torus-cpp/main.cpp
index 330700d4c..4ca4a3df8 100644
--- a/examples/torus-cpp/main.cpp
+++ b/examples/torus-cpp/main.cpp
@@ -46,6 +46,8 @@
#include <Qt3DCore/qentity.h>
#include <Qt3DCore/qcameralens.h>
+#include <Qt3DInput/QInputAspect>
+
#include <Qt3DRenderer/qtorusmesh.h>
#include <Qt3DRenderer/qmesh.h>
#include <Qt3DRenderer/qtechnique.h>
@@ -72,6 +74,8 @@ int main(int argc, char **argv)
Qt3D::Window view;
Qt3D::QAspectEngine engine;
engine.registerAspect(new Qt3D::QRenderAspect());
+ Qt3D::QInputAspect *input = new Qt3D::QInputAspect;
+ engine.registerAspect(input);
engine.initialize();
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
@@ -89,7 +93,7 @@ int main(int argc, char **argv)
cameraEntity->setPosition(QVector3D(0, 0, -20.0f));
cameraEntity->setUpVector(QVector3D(0, 1, 0));
cameraEntity->setViewCenter(QVector3D(0, 0, 0));
- view.setCamera(cameraEntity);
+ input->setCamera(cameraEntity);
// FrameGraph
Qt3D::QFrameGraph *frameGraph = new Qt3D::QFrameGraph();
diff --git a/examples/torus-cpp/torus-cpp.pro b/examples/torus-cpp/torus-cpp.pro
index 2bee5ff07..5ad940ff1 100644
--- a/examples/torus-cpp/torus-cpp.pro
+++ b/examples/torus-cpp/torus-cpp.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer
+QT += 3dcore 3drenderer 3dinput
SOURCES += main.cpp
diff --git a/examples/torus-qml/main.cpp b/examples/torus-qml/main.cpp
index 30ce9b65e..baa6daefb 100644
--- a/examples/torus-qml/main.cpp
+++ b/examples/torus-qml/main.cpp
@@ -41,7 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
-
+#include <Qt3DInput/QInputAspect>
#include <QGuiApplication>
#include <QtQml>
@@ -54,6 +54,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
QVariantMap data;
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
data.insert(QStringLiteral("window"), QVariant::fromValue(&view));
diff --git a/examples/torus-qml/torus-qml.pro b/examples/torus-qml/torus-qml.pro
index cb1a88003..060164fa9 100644
--- a/examples/torus-qml/torus-qml.pro
+++ b/examples/torus-qml/torus-qml.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
SOURCES += \
main.cpp
diff --git a/examples/wireframe/main.cpp b/examples/wireframe/main.cpp
index 71d792ac9..1dbdec85e 100644
--- a/examples/wireframe/main.cpp
+++ b/examples/wireframe/main.cpp
@@ -41,6 +41,7 @@
#include <Qt3DQuick/quickwindow.h>
#include <Qt3DRenderer/qrenderaspect.h>
+#include <Qt3DInput/QInputAspect>
#include <exampleresources.h>
@@ -57,6 +58,7 @@ int main(int argc, char* argv[])
Qt3D::Quick::QQmlAspectEngine engine;
engine.aspectEngine()->registerAspect(new Qt3D::QRenderAspect());
+ engine.aspectEngine()->registerAspect(new Qt3D::QInputAspect());
// Expose the window as a context property so we can set the aspect ratio
engine.qmlEngine()->rootContext()->setContextProperty("_window", &view);
diff --git a/examples/wireframe/wireframe.pro b/examples/wireframe/wireframe.pro
index 7dc5eb255..2b2fd991a 100644
--- a/examples/wireframe/wireframe.pro
+++ b/examples/wireframe/wireframe.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += 3dcore 3drenderer 3dquick qml quick
+QT += 3dcore 3drenderer 3dinput 3dquick qml quick
include("../exampleresources/exampleresources.pri")