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>
This commit is contained in:
Robert Brock 2016-05-03 14:04:51 +01:00 committed by Sean Harmer
parent 948a270134
commit 740cf6d842
1 changed files with 3 additions and 2 deletions

View File

@ -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);