summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFranck Arrecot <franck.arrecot@kdab.com>2016-03-10 09:58:16 +0100
committerFranck Arrecot <franck.arrecot@gmail.com>2016-03-11 13:55:04 +0000
commitc4d7ad6b1e4672a98384724f5aa45338686f2e64 (patch)
tree50fc2946e24b8d0c3cd849224c9924d012546d87 /examples
parent55e681ac6cad2a059785a08ac920748b5f60acf9 (diff)
Class QLogicComponent changes
Task-number: QTBUG-51448 Change-Id: I1359cbfe61dbef291859d15b16bda61639493432 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/examples-common/FirstPersonCameraController.qml4
-rw-r--r--examples/qt3d/examples-common/qfirstpersoncameracontroller.cpp14
-rw-r--r--examples/qt3d/examples-common/qfirstpersoncameracontroller.h2
-rw-r--r--examples/qt3d/examples-common/qfirstpersoncameracontroller_p.h6
-rw-r--r--examples/qt3d/planets-qml/SolarSystem.qml4
-rw-r--r--examples/qt3d/simple-qml/CameraController.qml4
6 files changed, 17 insertions, 17 deletions
diff --git a/examples/qt3d/examples-common/FirstPersonCameraController.qml b/examples/qt3d/examples-common/FirstPersonCameraController.qml
index 110824121..8d05c0840 100644
--- a/examples/qt3d/examples-common/FirstPersonCameraController.qml
+++ b/examples/qt3d/examples-common/FirstPersonCameraController.qml
@@ -160,8 +160,8 @@ Entity {
] // axes
},
- LogicComponent {
- onFrameUpdate: {
+ FrameAction {
+ onTriggered: {
// The time difference since the last frame is passed in as the
// argument dt. It is a floating point value in units of seconds.
root.camera.translate(Qt.vector3d(d.vx, d.vy, d.vz).times(dt))
diff --git a/examples/qt3d/examples-common/qfirstpersoncameracontroller.cpp b/examples/qt3d/examples-common/qfirstpersoncameracontroller.cpp
index b671fdfc7..0a2fefc30 100644
--- a/examples/qt3d/examples-common/qfirstpersoncameracontroller.cpp
+++ b/examples/qt3d/examples-common/qfirstpersoncameracontroller.cpp
@@ -59,7 +59,7 @@
#include <Qt3DInput/QKeyboardController>
#include <Qt3DInput/QMouseDevice>
#include <Qt3DInput/QMouseEvent>
-#include <Qt3DLogic/QLogicComponent>
+#include <Qt3DLogic/QFrameAction>
QT_BEGIN_NAMESPACE
@@ -89,7 +89,7 @@ QFirstPersonCameraControllerPrivate::QFirstPersonCameraControllerPrivate()
, m_keyboardController(new QKeyboardController())
, m_mouseDevice(new QMouseDevice())
, m_logicalDevice(new QLogicalDevice())
- , m_logicComponent(new Qt3DLogic::QLogicComponent())
+ , m_frameAction(new Qt3DLogic::QFrameAction())
, m_linearSpeed(10.0f)
, m_lookSpeed(180.0f)
, m_firstPersonUp(QVector3D(0.0f, 1.0f, 0.0f))
@@ -168,16 +168,16 @@ void QFirstPersonCameraControllerPrivate::init()
m_logicalDevice->addAxis(m_tzAxis);
Q_Q(QFirstPersonCameraController);
- //// LogicComponent
+ //// FrameAction
- QObject::connect(m_logicComponent, SIGNAL(frameUpdate(float)),
- q, SLOT(_q_onFrameUpdate(float)));
+ QObject::connect(m_frameAction, SIGNAL(triggered(float)),
+ q, SLOT(_q_onTriggered(float)));
- q->addComponent(m_logicComponent);
+ q->addComponent(m_frameAction);
q->addComponent(m_logicalDevice);
}
-void QFirstPersonCameraControllerPrivate::_q_onFrameUpdate(float dt)
+void QFirstPersonCameraControllerPrivate::_q_onTriggered(float dt)
{
if (m_camera != Q_NULLPTR) {
m_camera->translate(QVector3D(m_txAxis->value() * m_linearSpeed,
diff --git a/examples/qt3d/examples-common/qfirstpersoncameracontroller.h b/examples/qt3d/examples-common/qfirstpersoncameracontroller.h
index be1496936..5b9019586 100644
--- a/examples/qt3d/examples-common/qfirstpersoncameracontroller.h
+++ b/examples/qt3d/examples-common/qfirstpersoncameracontroller.h
@@ -89,7 +89,7 @@ Q_SIGNALS:
private:
Q_DECLARE_PRIVATE(QFirstPersonCameraController)
- Q_PRIVATE_SLOT(d_func(), void _q_onFrameUpdate(float))
+ Q_PRIVATE_SLOT(d_func(), void _q_onTriggered(float))
};
} // Qt3DInput
diff --git a/examples/qt3d/examples-common/qfirstpersoncameracontroller_p.h b/examples/qt3d/examples-common/qfirstpersoncameracontroller_p.h
index bc8cf978c..59b03b1ea 100644
--- a/examples/qt3d/examples-common/qfirstpersoncameracontroller_p.h
+++ b/examples/qt3d/examples-common/qfirstpersoncameracontroller_p.h
@@ -62,7 +62,7 @@ class QCamera;
}
namespace Qt3DLogic {
-class QLogicComponent;
+class QFrameAction;
}
namespace Qt3DInput {
@@ -111,13 +111,13 @@ public:
QLogicalDevice *m_logicalDevice;
- Qt3DLogic::QLogicComponent *m_logicComponent;
+ Qt3DLogic::QFrameAction *m_frameAction;
float m_linearSpeed;
float m_lookSpeed;
QVector3D m_firstPersonUp;
- void _q_onFrameUpdate(float);
+ void _q_onTriggered(float);
Q_DECLARE_PUBLIC(QFirstPersonCameraController)
};
diff --git a/examples/qt3d/planets-qml/SolarSystem.qml b/examples/qt3d/planets-qml/SolarSystem.qml
index b87d5fe3c..62ad9a27c 100644
--- a/examples/qt3d/planets-qml/SolarSystem.qml
+++ b/examples/qt3d/planets-qml/SolarSystem.qml
@@ -115,8 +115,8 @@ Entity {
property real actualScale
// Animate solar system with LogicComponent
- LogicComponent {
- onFrameUpdate: {
+ FrameAction {
+ onTriggered: {
frames++
animate(focusedPlanet)
}
diff --git a/examples/qt3d/simple-qml/CameraController.qml b/examples/qt3d/simple-qml/CameraController.qml
index edd25bffc..6b5b24307 100644
--- a/examples/qt3d/simple-qml/CameraController.qml
+++ b/examples/qt3d/simple-qml/CameraController.qml
@@ -272,8 +272,8 @@ Entity {
}
},
- LogicComponent {
- onFrameUpdate: {
+ FrameAction {
+ onTriggered: {
// The time difference since the last frame is passed in as the
// argument dt. It is a floating point value in units of seconds.
root.camera.translate(Qt.vector3d(d.vx, d.vy, d.vz).times(dt))