now the update frame is only happening in the assignment client code. added setCurrentlyPlayingFrame to ModelEntityItem.cpp

This commit is contained in:
amantley 2017-11-20 09:11:15 -08:00
parent 013d16cee9
commit befa0f8ab5
3 changed files with 11 additions and 1 deletions

View file

@ -309,7 +309,8 @@ void EntityTreeRenderer::update(bool simulate) {
PerformanceTimer perfTimer("ETRupdate");
if (_tree && !_shuttingDown) {
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
tree->update(simulate);
//angus
//tree->update(simulate);
// Update the rendereable entities as needed
{

View file

@ -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<bool>([&] {

View file

@ -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);