+ // If there is delay time before Animation starts, wait the Animation until mDelaySeconds.
+ if(mDelaySeconds > 0.0f)
+ {
+ float reduceSeconds = fabsf(elapsedSeconds * mSpeedFactor);
+ if(reduceSeconds > mDelaySeconds)
+ {
+ // add overflowed time to mElapsedSecond.
+ // If speed factor > 0, add it. if speed factor < 0, subtract it.
+ float overflowSeconds = reduceSeconds - mDelaySeconds;
+ mElapsedSeconds += signSpeedFactor * overflowSeconds;
+ mDelaySeconds = 0.0f;
+ }
+ else
+ {
+ mDelaySeconds -= reduceSeconds;
+ }
+ }
+ else
+ {
+ mElapsedSeconds += (elapsedSeconds * mSpeedFactor);
+ }