summaryrefslogtreecommitdiffstats
path: root/src/logic/executor_p.h
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-12-06 14:58:41 +0000
committerSean Harmer <sean.harmer@kdab.com>2015-12-07 19:07:29 +0000
commit8e585245bc1cb5a35269e7b5210b13a34ed886d3 (patch)
tree0cc0c05bc860ca2c10876a770aaf88d4b06cfa84 /src/logic/executor_p.h
parentc807454297e171abc822e56dc5940d61a3d9abd3 (diff)
Pass frame time delta through to the logic component frame update
Allows for smoother animations in logic components. Change-Id: I2aad5055465b3afbac415e21a356e216701551ef Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/logic/executor_p.h')
-rw-r--r--src/logic/executor_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/logic/executor_p.h b/src/logic/executor_p.h
index ec48a3e38..79effddb3 100644
--- a/src/logic/executor_p.h
+++ b/src/logic/executor_p.h
@@ -66,9 +66,15 @@ namespace Logic {
class FrameUpdateEvent : public QEvent
{
public:
- FrameUpdateEvent()
+ FrameUpdateEvent(float dt)
: QEvent(QEvent::User)
+ , m_dt(dt)
{}
+
+ float deltaTime() const { return m_dt; }
+
+private:
+ float m_dt;
};
class Executor : public QObject
@@ -86,7 +92,7 @@ public Q_SLOTS:
protected:
bool event(QEvent *e);
- void processLogicFrameUpdates();
+ void processLogicFrameUpdates(float dt);
private:
QVector<Qt3DCore::QNodeId> m_nodeIds;