summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/simple-cpp
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-05-03 14:04:51 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-06 16:56:42 +0000
commit740cf6d8427b05fab7f9f83de8b8b0b3b7b519a0 (patch)
tree8c269fc48e854e4321e981cfb98ed0c587b227cc /examples/qt3d/simple-cpp
parent948a270134f19a065bb73f74abd096b1fb5e1ac8 (diff)
Replaced FPS Camera with Orbit - Simple-cpp
Simple-Cpp example now has OrbitCameraController instead of FirstPersonCameraController Added line setting view center to be a more complete example. Part of the examples cleanup. Change-Id: Ib59d9cc8263e082c4ddce64ad129493fba044ae1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/simple-cpp')
-rw-r--r--examples/qt3d/simple-cpp/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/qt3d/simple-cpp/main.cpp b/examples/qt3d/simple-cpp/main.cpp
index af7f1f9d9..d3a6728ca 100644
--- a/examples/qt3d/simple-cpp/main.cpp
+++ b/examples/qt3d/simple-cpp/main.cpp
@@ -69,7 +69,7 @@
#include "qt3dwindow.h"
#include "orbittransformcontroller.h"
-#include "qfirstpersoncameracontroller.h"
+#include "qorbitcameracontroller.h"
Qt3DCore::QEntity *createScene()
{
@@ -132,9 +132,10 @@ int main(int argc, char* argv[])
Qt3DRender::QCamera *camera = view.camera();
camera->lens()->setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f);
camera->setPosition(QVector3D(0, 0, 40.0f));
+ camera->setViewCenter(QVector3D(0, 0, 0));
// For camera controls
- Qt3DExtras::QFirstPersonCameraController *camController = new Qt3DExtras::QFirstPersonCameraController(scene);
+ Qt3DExtras::QOrbitCameraController *camController = new Qt3DExtras::QOrbitCameraController(scene);
camController->setLinearSpeed( 50.0f );
camController->setLookSpeed( 180.0f );
camController->setCamera(camera);