mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:18:12 +02:00
now the update frame is only happening in the assignment client code. added setCurrentlyPlayingFrame to ModelEntityItem.cpp
This commit is contained in:
parent
013d16cee9
commit
befa0f8ab5
3 changed files with 11 additions and 1 deletions
|
@ -309,7 +309,8 @@ void EntityTreeRenderer::update(bool simulate) {
|
||||||
PerformanceTimer perfTimer("ETRupdate");
|
PerformanceTimer perfTimer("ETRupdate");
|
||||||
if (_tree && !_shuttingDown) {
|
if (_tree && !_shuttingDown) {
|
||||||
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
|
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
|
||||||
tree->update(simulate);
|
//angus
|
||||||
|
//tree->update(simulate);
|
||||||
|
|
||||||
// Update the rendereable entities as needed
|
// Update the rendereable entities as needed
|
||||||
{
|
{
|
||||||
|
|
|
@ -254,6 +254,7 @@ void ModelEntityItem::updateFrameCount() {
|
||||||
float deltaTime = (float)interval / (float)USECS_PER_SECOND;
|
float deltaTime = (float)interval / (float)USECS_PER_SECOND;
|
||||||
_currentlyPlayingFrame += (deltaTime * _previousAnimationProperties.getFPS());
|
_currentlyPlayingFrame += (deltaTime * _previousAnimationProperties.getFPS());
|
||||||
qCDebug(entities) << "the frame is now " << _currentlyPlayingFrame;
|
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) {
|
void ModelEntityItem::setAnimationLoop(bool loop) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_animationProperties.setLoop(loop);
|
_animationProperties.setLoop(loop);
|
||||||
|
@ -669,6 +676,7 @@ float ModelEntityItem::getAnimationCurrentFrame() const {
|
||||||
return _animationProperties.getCurrentFrame();
|
return _animationProperties.getCurrentFrame();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//angus change
|
//angus change
|
||||||
bool ModelEntityItem::isAnimatingSomething() const {
|
bool ModelEntityItem::isAnimatingSomething() const {
|
||||||
return resultWithReadLock<bool>([&] {
|
return resultWithReadLock<bool>([&] {
|
||||||
|
|
|
@ -87,6 +87,7 @@ public:
|
||||||
void setAnimationURL(const QString& url);
|
void setAnimationURL(const QString& url);
|
||||||
|
|
||||||
void setAnimationCurrentFrame(float value);
|
void setAnimationCurrentFrame(float value);
|
||||||
|
void setAnimationCurrentlyPlayingFrame(float value);
|
||||||
void setAnimationIsPlaying(bool value);
|
void setAnimationIsPlaying(bool value);
|
||||||
void setAnimationFPS(float value);
|
void setAnimationFPS(float value);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue