You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I took a stab at implementing PingPong, this is the way that seems to make sense to me, might be able to be expressed better.
caseStyle::PingPong:
{
// calculate time period with time frames of 2 complete sequencesfloat pingPongTime =
fmod(fTime * m_fFrameRate, m_vFrames.size() * 2);
// calculate the current frame indexsize_tindex = (size_t(pingPongTime) % m_vFrames.size());
// if we're on the second sequence, run in reverseif(pingPongTime > m_vFrames.size())
return (m_vFrames.size() - 1) - index;
// if we made it here, we're handing the first sequence, run forwardreturnindex;
}
break;
I took a stab at implementing PingPong, this is the way that seems to make sense to me, might be able to be expressed better.
olcPixelGameEngine/utilities/olcUTIL_Animate2D.h
Line 143 in 147c25a
The text was updated successfully, but these errors were encountered: