@ -59,17 +59,17 @@ int AnimationInfo::GetFrameToUseForRendering() const
float AnimationInfo : : GetAnimationProgress ( ) const
{
in t ticksSinceSequenceStarted = TicksSinceSequenceStarted ;
floa t ticksSinceSequenceStarted = TicksSinceSequenceStarted ;
float tickModifier = TickModifier ;
if ( RelevantFramesForDistributing < = 0 ) {
// This logic is used if animation distribution is not active (see GetFrameToUseForRendering).
// In this case the variables calculated with animation distribution are not initialized and we have to calculate them on the fly with the given information.
ticksSinceSequenceStarted = ( ( CurrentFrame - 1 ) * TicksPerFrame ) + TickCounterOfCurrentFrame ;
ticksSinceSequenceStarted = static_cast < float > ( ( ( CurrentFrame - 1 ) * TicksPerFrame ) + TickCounterOfCurrentFrame ) ;
tickModifier = 1.0F / static_cast < float > ( TicksPerFrame ) ;
}
float totalTicksForCurrentAnimationSequence = GetProgressToNextGameTick ( ) + static_cast < float > ( ticksSinceSequenceStarted ) ;
float totalTicksForCurrentAnimationSequence = GetProgressToNextGameTick ( ) + ticksSinceSequenceStarted ;
float progressInAnimationFrames = totalTicksForCurrentAnimationSequence * tickModifier ;
float animationFraction = progressInAnimationFrames / static_cast < float > ( NumberOfFrames ) ;
return animationFraction ;