From 0b90046aaae29dc11a2175e92065c6af87795d22 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sat, 31 Aug 2013 17:38:20 -0700 Subject: [PATCH] Animation fixes for curves that do not start on frame 0 --HG-- branch : nfb --- KREngine/kraken/KRAnimation.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/KREngine/kraken/KRAnimation.cpp b/KREngine/kraken/KRAnimation.cpp index 093ef13..02b99a8 100644 --- a/KREngine/kraken/KRAnimation.cpp +++ b/KREngine/kraken/KRAnimation.cpp @@ -164,16 +164,8 @@ void KRAnimation::update(float deltaTime) KRNode::node_attribute_type attribute_type = attribute->getTargetAttribute(); if(curve != NULL && target != NULL) { - int frame_number = (int)((m_local_time + m_start_time) * curve->getFrameRate()); - if(frame_number < curve->getFrameStart()) { - target->SetAttribute(attribute_type, curve->getValue(m_start_time)); - } else if(frame_number - curve->getFrameStart() >= curve->getFrameCount()) { - target->SetAttribute(attribute_type, curve->getValue(curve->getFrameCount() - 1)); - } else { - target->SetAttribute(attribute_type, curve->getValue(frame_number - curve->getFrameStart())); - } + target->SetAttribute(attribute_type, curve->getValue(m_local_time + m_start_time)); } - } } }