Now things seems to work. Animation speed taking FPS into account and also can be tweak (as suggested above).
Blending in and out works. Great tips guys. Thanks
void Animation::Animate( Float appTime, const Animation::Blending& blending)
switch( blending )
{
// no blending
case None:
_blend = 1;
break;
// blend in
case In:
_blend += _fadeIn*AppSpeed();
_blend = std::min<Float>(_blend,1);
break;
// blend out
case Out:
_blend -= _fadeOut*AppSpeed();
_blend = std::max<Float>(_blend,0);
break;
}
Update(appTime);
}
void Animation::Update( Float appTime )
{
// time to update frame counter?
if( appTime > _lastTime )
{
_lastTime = appTime;
// increment taking FPS rate into account
_frame += AppSpeed() * _speed ;
// correction for under- and overflows
_frame = std::max<Float>(0,_frame);
_frame = std::min<Float>(_frame,static_cast<Float>(_frames));
// restart?
if( _frame == _frames )
_frame = 0;
}
// don't bother about animations with blend values of 0
if( _blend > 0 )
_model.Animate( _frame, _blend, _seq );
}