Merge pull request #4022 from ZappoMan/animationFrameIndex

fix one more case of animaiton stutter
This commit is contained in:
Philip Rosedale 2014-12-30 15:47:19 -08:00
commit 4f06c271c0

View file

@ -18,7 +18,6 @@
#include "EntityTreeElement.h"
#include "ModelEntityItem.h"
const QString ModelEntityItem::DEFAULT_MODEL_URL = QString("");
const QString ModelEntityItem::DEFAULT_ANIMATION_URL = QString("");
const float ModelEntityItem::DEFAULT_ANIMATION_FRAME_INDEX = 0.0f;
@ -343,9 +342,6 @@ QVector<glm::quat> ModelEntityItem::getAnimationFrame() {
Animation* myAnimation = getAnimation(_animationURL);
QVector<FBXAnimationFrame> frames = myAnimation->getFrames();
int frameCount = frames.size();
if (_animationLoop.getMaxFrameIndexHint() != frameCount) {
_animationLoop.setMaxFrameIndexHint(frameCount);
}
if (frameCount > 0) {
int animationFrameIndex = (int)(glm::floor(getAnimationFrameIndex())) % frameCount;
if (animationFrameIndex < 0 || animationFrameIndex > frameCount) {