From d2ab3e69f09b27ffcd6e9e3eb7433a86fc8f15ad Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 12 Nov 2014 14:59:03 -0800 Subject: [PATCH] some cleanup --- interface/src/renderer/AnimationHandle.cpp | 26 +++++----------------- interface/src/renderer/AnimationHandle.h | 11 --------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/interface/src/renderer/AnimationHandle.cpp b/interface/src/renderer/AnimationHandle.cpp index caddd8c4b6..767f941049 100644 --- a/interface/src/renderer/AnimationHandle.cpp +++ b/interface/src/renderer/AnimationHandle.cpp @@ -138,26 +138,12 @@ void AnimationHandle::simulate(float deltaTime) { return; } - /* - float endFrameIndex = qMin(_lastFrame, animationGeometry.animationFrames.size() - (_loop ? 0.0f : 1.0f)); - float startFrameIndex = qMin(_firstFrame, endFrameIndex); - if ((!_loop && (_frameIndex < startFrameIndex || _frameIndex > endFrameIndex)) || startFrameIndex == endFrameIndex) { - // passed the end; apply the last frame - applyFrame(glm::clamp(_frameIndex, startFrameIndex, endFrameIndex)); - if (!_hold) { - stop(); - } - return; - } - // wrap within the the desired range - if (_frameIndex < startFrameIndex) { - _frameIndex = endFrameIndex - glm::mod(endFrameIndex - _frameIndex, endFrameIndex - startFrameIndex); - - } else if (_frameIndex > endFrameIndex) { - _frameIndex = startFrameIndex + glm::mod(_frameIndex - startFrameIndex, endFrameIndex - startFrameIndex); - } - */ - + // TODO: When moving the loop/frame calculations to AnimationLoop class, we changed this behavior + // see AnimationLoop class for more details. Do we need to support clamping the endFrameIndex to + // the max number of frames in the geometry??? + // + // float endFrameIndex = qMin(_lastFrame, animationGeometry.animationFrames.size() - (_loop ? 0.0f : 1.0f)); + // blend between the closest two frames applyFrame(getFrameIndex()); } diff --git a/interface/src/renderer/AnimationHandle.h b/interface/src/renderer/AnimationHandle.h index aa030e6350..3956b01ebf 100644 --- a/interface/src/renderer/AnimationHandle.h +++ b/interface/src/renderer/AnimationHandle.h @@ -104,17 +104,6 @@ private: QVector _jointMappings; AnimationLoop _animationLoop; - - /* - float _fps; - bool _loop; - bool _hold; - bool _startAutomatically; - float _firstFrame; - float _lastFrame; - bool _running; - float _frameIndex; - */ };