diff options
Diffstat (limited to 'src/animation/backend/clipanimator.cpp')
-rw-r--r-- | src/animation/backend/clipanimator.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/animation/backend/clipanimator.cpp b/src/animation/backend/clipanimator.cpp index 65fd0f57f..ea31698d0 100644 --- a/src/animation/backend/clipanimator.cpp +++ b/src/animation/backend/clipanimator.cpp @@ -40,6 +40,7 @@ #include <Qt3DAnimation/private/animationclip_p.h> #include <Qt3DAnimation/private/managers_p.h> #include <Qt3DAnimation/private/animationlogging_p.h> +#include <Qt3DAnimation/private/qanimationcallbacktrigger_p.h> #include <Qt3DCore/qpropertyupdatedchange.h> #include <Qt3DCore/private/qpropertyupdatedchangebase_p.h> @@ -129,6 +130,21 @@ void ClipAnimator::sendPropertyChanges(const QVector<Qt3DCore::QSceneChangePtr> notifyObservers(change); } +void ClipAnimator::sendCallbacks(const QVector<AnimationCallbackAndValue> &callbacks) +{ + for (const AnimationCallbackAndValue &callback : callbacks) { + if (callback.flags.testFlag(QAnimationCallback::OnThreadPool)) { + callback.callback->valueChanged(callback.value); + } else { + auto e = QAnimationCallbackTriggerPtr::create(peerId()); + e->setCallback(callback.callback); + e->setValue(callback.value); + e->setDeliveryFlags(Qt3DCore::QSceneChange::Nodes); + notifyObservers(e); + } + } +} + } // namespace Animation } // namespace Qt3DAnimation |