summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--src/logic/executor.cpp8
-rw-r--r--src/logic/logic.pri6
-rw-r--r--src/logic/qframeaction.cpp (renamed from src/logic/qlogiccomponent.cpp)34
-rw-r--r--src/logic/qframeaction.h (renamed from src/logic/qlogiccomponent.h)24
-rw-r--r--src/logic/qframeaction_p.h (renamed from src/logic/qlogiccomponent_p.h)14
-rw-r--r--src/logic/qlogicaspect.cpp4
-rw-r--r--src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp4
13 files changed, 64 insertions, 64 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))
diff --git a/src/logic/executor.cpp b/src/logic/executor.cpp
index 5ca3cb229..c8eb6881f 100644
--- a/src/logic/executor.cpp
+++ b/src/logic/executor.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "executor_p.h"
-#include <Qt3DLogic/qlogiccomponent.h>
+#include <Qt3DLogic/qframeaction.h>
#include <Qt3DCore/qnode.h>
#include <Qt3DCore/private/qscene_p.h>
#include <QtCore/qsemaphore.h>
@@ -93,9 +93,9 @@ void Executor::processLogicFrameUpdates(float dt)
Q_ASSERT(m_semaphore);
const QVector<QNode *> nodes = m_scene->lookupNodes(m_nodeIds);
for (QNode *node : nodes) {
- QLogicComponent *logicComponent = qobject_cast<QLogicComponent *>(node);
- if (logicComponent)
- logicComponent->onFrameUpdate(dt);
+ QFrameAction *frameAction = qobject_cast<QFrameAction *>(node);
+ if (frameAction)
+ frameAction->onTriggered(dt);
}
// Release the semaphore so the calling Manager can continue
diff --git a/src/logic/logic.pri b/src/logic/logic.pri
index b8291f075..a8a3573a8 100644
--- a/src/logic/logic.pri
+++ b/src/logic/logic.pri
@@ -4,9 +4,9 @@ HEADERS += \
$$PWD/qt3dlogic_global.h \
$$PWD/qlogicaspect.h \
$$PWD/qlogicaspect_p.h \
- $$PWD/qlogiccomponent.h \
+ $$PWD/qframeaction.h \
$$PWD/handle_types_p.h \
- $$PWD/qlogiccomponent_p.h \
+ $$PWD/qframeaction_p.h \
$$PWD/callbackjob_p.h \
$$PWD/executor_p.h \
$$PWD/handler_p.h \
@@ -15,7 +15,7 @@ HEADERS += \
SOURCES += \
$$PWD/qlogicaspect.cpp \
- $$PWD/qlogiccomponent.cpp \
+ $$PWD/qframeaction.cpp \
$$PWD/manager.cpp \
$$PWD/handler.cpp \
$$PWD/executor.cpp \
diff --git a/src/logic/qlogiccomponent.cpp b/src/logic/qframeaction.cpp
index 2ea9b03a1..27d969235 100644
--- a/src/logic/qlogiccomponent.cpp
+++ b/src/logic/qframeaction.cpp
@@ -37,59 +37,59 @@
**
****************************************************************************/
-#include "qlogiccomponent.h"
-#include "qlogiccomponent_p.h"
+#include "qframeaction.h"
+#include "qframeaction_p.h"
QT_BEGIN_NAMESPACE
namespace Qt3DLogic {
-QLogicComponentPrivate::QLogicComponentPrivate()
+QFrameActionPrivate::QFrameActionPrivate()
: QComponentPrivate()
{
}
/*!
- \class Qt3DLogic::QLogicComponent
+ \class Qt3DLogic::QFrameAction
\inmodule Qt3DLogic
\since 5.5
\brief Provides a way to have a synchronous function executed each frame.
- The QLogicComponent provides a way to perform tasks each frame in
+ The QFrameAction provides a way to perform tasks each frame in
synchronized with the Qt3D backend. This is useful to implement some
aspects of application logic and to prototype functionality that can later
be folded into an additional Qt3D aspect.
- For example, the QLogicComponent can be used to animate a property in sync
+ For example, the QFrameAction can be used to animate a property in sync
with the Qt3D engine where a Qt Quick animation element is not perfectly
synchronized and may lead to stutters in some cases.
- To execute your own code each frame override the onFrameUpdate function.
+ To execute your own code each frame override the onTriggered function.
*/
/*!
- \qmltype LogicComponent
+ \qmltype FrameAction
\inqmlmodule Qt3D.Logic
- \instantiates Qt3DLogic::QLogicComponent
+ \instantiates Qt3DLogic::QFrameAction
\inherits Component3D
\since 5.5
*/
/*!
- Constructs a new QLogicComponent instance with parent \a parent.
+ Constructs a new QFrameAction instance with parent \a parent.
*/
-QLogicComponent::QLogicComponent(QNode *parent)
- : QComponent(*new QLogicComponentPrivate, parent)
+QFrameAction::QFrameAction(QNode *parent)
+ : QComponent(*new QFrameActionPrivate, parent)
{
}
/*! \internal */
-QLogicComponent::QLogicComponent(QLogicComponentPrivate &dd, QNode *parent)
+QFrameAction::QFrameAction(QFrameActionPrivate &dd, QNode *parent)
: QComponent(dd, parent)
{
}
-QLogicComponent::~QLogicComponent()
+QFrameAction::~QFrameAction()
{
QNode::cleanup();
}
@@ -98,11 +98,11 @@ QLogicComponent::~QLogicComponent()
This virtual function will be called in a synchronous manner once each frame by
the Logic aspect.
*/
-void QLogicComponent::onFrameUpdate(float dt)
+void QFrameAction::onTriggered(float dt)
{
- // Emit signal so that QML instances get the onFrameUpdate() signal
+ // Emit signal so that QML instances get the onTriggered() signal
// handler called
- emit frameUpdate(dt);
+ emit triggered(dt);
}
} // namespace Qt3DLogic
diff --git a/src/logic/qlogiccomponent.h b/src/logic/qframeaction.h
index 084aecfb8..52ef1b9b0 100644
--- a/src/logic/qlogiccomponent.h
+++ b/src/logic/qframeaction.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QT3DLOGIC_QLOGICCOMPONENT_H
-#define QT3DLOGIC_QLOGICCOMPONENT_H
+#ifndef QT3DLOGIC_QFRAMEACTION_H
+#define QT3DLOGIC_QFRAMEACTION_H
#include <Qt3DCore/qcomponent.h>
#include <Qt3DLogic/qt3dlogic_global.h>
@@ -48,31 +48,31 @@ QT_BEGIN_NAMESPACE
namespace Qt3DLogic {
class QLogicAspect;
-class QLogicComponentPrivate;
+class QFrameActionPrivate;
namespace Logic {
class Executor;
}
-class QT3DLOGICSHARED_EXPORT QLogicComponent : public Qt3DCore::QComponent
+class QT3DLOGICSHARED_EXPORT QFrameAction : public Qt3DCore::QComponent
{
Q_OBJECT
public:
- explicit QLogicComponent(Qt3DCore::QNode *parent = 0);
- ~QLogicComponent();
+ explicit QFrameAction(Qt3DCore::QNode *parent = 0);
+ ~QFrameAction();
protected:
- QLogicComponent(QLogicComponentPrivate &dd, QNode *parent = 0);
+ QFrameAction(QFrameActionPrivate &dd, QNode *parent = 0);
Q_SIGNALS:
- void frameUpdate(float dt);
+ void triggered(float dt);
private:
- Q_DECLARE_PRIVATE(QLogicComponent)
- QT3D_CLONEABLE(QLogicComponent)
+ Q_DECLARE_PRIVATE(QFrameAction)
+ QT3D_CLONEABLE(QFrameAction)
- virtual void onFrameUpdate(float dt);
+ virtual void onTriggered(float dt);
friend class Logic::Executor;
};
@@ -81,4 +81,4 @@ private:
QT_END_NAMESPACE
-#endif // QT3DLOGIC_QLOGICCOMPONENT_H
+#endif // QT3DLOGIC_QFRAMEACTION_H
diff --git a/src/logic/qlogiccomponent_p.h b/src/logic/qframeaction_p.h
index 5c23f9d89..17155ffd3 100644
--- a/src/logic/qlogiccomponent_p.h
+++ b/src/logic/qframeaction_p.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QT3DLOGIC_QLOGICCOMPONENT_P_H
-#define QT3DLOGIC_QLOGICCOMPONENT_P_H
+#ifndef QT3DLOGIC_QFRAMEACTION_P_H
+#define QT3DLOGIC_QFRAMEACTION_P_H
//
// W A R N I N G
@@ -57,18 +57,18 @@ QT_BEGIN_NAMESPACE
namespace Qt3DLogic {
-class QLogicComponent;
+class QFrameAction;
-class QLogicComponentPrivate : public Qt3DCore::QComponentPrivate
+class QFrameActionPrivate : public Qt3DCore::QComponentPrivate
{
public:
- QLogicComponentPrivate();
+ QFrameActionPrivate();
- Q_DECLARE_PUBLIC(QLogicComponent)
+ Q_DECLARE_PUBLIC(QFrameAction)
};
} // namespace Qt3DLogic
QT_END_NAMESPACE
-#endif // QT3DLOGIC_QLOGICCOMPONENT_P_H
+#endif // QT3DLOGIC_QFRAMEACTION_P_H
diff --git a/src/logic/qlogicaspect.cpp b/src/logic/qlogicaspect.cpp
index 5c72cde0d..79f4df34d 100644
--- a/src/logic/qlogicaspect.cpp
+++ b/src/logic/qlogicaspect.cpp
@@ -42,7 +42,7 @@
#include "executor_p.h"
#include "handler_p.h"
#include "manager_p.h"
-#include "qlogiccomponent.h"
+#include "qframeaction.h"
#include <Qt3DCore/qnode.h>
#include <Qt3DCore/private/qchangearbiter_p.h>
@@ -87,7 +87,7 @@ QLogicAspect::QLogicAspect(QLogicAspectPrivate &dd, QObject *parent)
void QLogicAspect::registerBackendTypes()
{
- registerBackendType<QLogicComponent>(QBackendNodeMapperPtr(new Logic::HandlerFunctor(d_func()->m_manager.data())));
+ registerBackendType<QFrameAction>(QBackendNodeMapperPtr(new Logic::HandlerFunctor(d_func()->m_manager.data())));
}
QVector<QAspectJobPtr> QLogicAspect::jobsToExecute(qint64 time)
diff --git a/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp b/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
index 963221e8f..3f96928b7 100644
--- a/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
+++ b/src/quick3d/imports/logic/qt3dquick3dlogicplugin.cpp
@@ -38,14 +38,14 @@
****************************************************************************/
#include <QtQml>
-#include <Qt3DLogic/qlogiccomponent.h>
+#include <Qt3DLogic/qframeaction.h>
#include "qt3dquick3dlogicplugin.h"
QT_BEGIN_NAMESPACE
void Qt3DQuick3DLogicPlugin::registerTypes(const char *uri)
{
- qmlRegisterType<Qt3DLogic::QLogicComponent>(uri, 2, 0, "LogicComponent");
+ qmlRegisterType<Qt3DLogic::QFrameAction>(uri, 2, 0, "FrameAction");
}
QT_END_NAMESPACE