From befa0f8ab54de74211b85361565c86bd9351f138 Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 20 Nov 2017 09:11:15 -0800 Subject: [PATCH] now the update frame is only happening in the assignment client code. added setCurrentlyPlayingFrame to ModelEntityItem.cpp --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 3 ++- libraries/entities/src/ModelEntityItem.cpp | 8 ++++++++ libraries/entities/src/ModelEntityItem.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 07d8716656..42fcd9af6f 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -309,7 +309,8 @@ void EntityTreeRenderer::update(bool simulate) { PerformanceTimer perfTimer("ETRupdate"); if (_tree && !_shuttingDown) { EntityTreePointer tree = std::static_pointer_cast(_tree); - tree->update(simulate); + //angus + //tree->update(simulate); // Update the rendereable entities as needed { diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 67357a6905..c6e6a7a069 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -254,6 +254,7 @@ void ModelEntityItem::updateFrameCount() { float deltaTime = (float)interval / (float)USECS_PER_SECOND; _currentlyPlayingFrame += (deltaTime * _previousAnimationProperties.getFPS()); qCDebug(entities) << "the frame is now " << _currentlyPlayingFrame; + setAnimationCurrentlyPlayingFrame(_currentlyPlayingFrame); } } } @@ -609,6 +610,12 @@ void ModelEntityItem::setAnimationCurrentFrame(float value) { }); } +void ModelEntityItem::setAnimationCurrentlyPlayingFrame(float value) { + withWriteLock([&] { + _animationProperties.setCurrentlyPlayingFrame(value); + }); +} + void ModelEntityItem::setAnimationLoop(bool loop) { withWriteLock([&] { _animationProperties.setLoop(loop); @@ -669,6 +676,7 @@ float ModelEntityItem::getAnimationCurrentFrame() const { return _animationProperties.getCurrentFrame(); }); } + //angus change bool ModelEntityItem::isAnimatingSomething() const { return resultWithReadLock([&] { diff --git a/libraries/entities/src/ModelEntityItem.h b/libraries/entities/src/ModelEntityItem.h index 3df0ccdc36..1c1c834d82 100644 --- a/libraries/entities/src/ModelEntityItem.h +++ b/libraries/entities/src/ModelEntityItem.h @@ -87,6 +87,7 @@ public: void setAnimationURL(const QString& url); void setAnimationCurrentFrame(float value); + void setAnimationCurrentlyPlayingFrame(float value); void setAnimationIsPlaying(bool value); void setAnimationFPS(float value);