1// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "executor_p.h"
5
6#include <Qt3DLogic/qframeaction.h>
7#include <Qt3DCore/qnode.h>
8#include <QtCore/qsemaphore.h>
9
10#include <Qt3DCore/private/qscene_p.h>
11
12QT_BEGIN_NAMESPACE
13
14
15namespace Qt3DLogic {
16namespace Logic {
17
18using namespace Qt3DCore;
19
20Executor::Executor(QObject *parent)
21 : QObject(parent)
22 , m_scene(nullptr)
23{
24}
25
26/*!
27 Called from context of main thread
28*/
29void Executor::processLogicFrameUpdates(const QList<QNodeId> &nodeIds, float dt)
30{
31 if (!m_scene || nodeIds.isEmpty())
32 return;
33
34 const QList<QNode *> nodes = m_scene->lookupNodes(ids: nodeIds);
35 for (QNode *node : nodes) {
36 QFrameAction *frameAction = qobject_cast<QFrameAction *>(object: node);
37 if (frameAction && frameAction->isEnabled())
38 frameAction->onTriggered(dt);
39 }
40}
41
42} // namespace Logic
43} // namespace Qt3DLogic
44
45QT_END_NAMESPACE
46
47#include "moc_executor_p.cpp"
48

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

source code of qt3d/src/logic/executor.cpp