mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:53:03 +02:00
fix bug in animation jitter on turn
This commit is contained in:
parent
744f9bc508
commit
7b69642c67
1 changed files with 6 additions and 3 deletions
|
@ -115,7 +115,9 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
|||
READ_ENTITY_PROPERTY(PROP_ANIMATION_PLAYING, bool, animationIsPlaying);
|
||||
|
||||
if (propertyFlags.getHasProperty(PROP_ANIMATION_PLAYING)) {
|
||||
setAnimationIsPlaying(animationIsPlaying);
|
||||
if (animationIsPlaying != getAnimationIsPlaying()) {
|
||||
setAnimationIsPlaying(animationIsPlaying);
|
||||
}
|
||||
}
|
||||
if (propertyFlags.getHasProperty(PROP_ANIMATION_FPS)) {
|
||||
setAnimationFPS(animationFPS);
|
||||
|
@ -345,7 +347,6 @@ QVector<glm::quat> ModelEntityItem::getAnimationFrame() {
|
|||
|
||||
if (frameCount > 0) {
|
||||
int animationFrameIndex = (int)(glm::floor(getAnimationFrameIndex())) % frameCount;
|
||||
|
||||
if (animationFrameIndex < 0 || animationFrameIndex > frameCount) {
|
||||
animationFrameIndex = 0;
|
||||
}
|
||||
|
@ -427,7 +428,9 @@ void ModelEntityItem::setAnimationSettings(const QString& value) {
|
|||
|
||||
if (settingsMap.contains("running")) {
|
||||
bool running = settingsMap["running"].toBool();
|
||||
setAnimationIsPlaying(running);
|
||||
if (running != getAnimationIsPlaying()) {
|
||||
setAnimationIsPlaying(running);
|
||||
}
|
||||
}
|
||||
|
||||
if (settingsMap.contains("firstFrame")) {
|
||||
|
|
Loading…
Reference in a new issue