Linear Interpolating rotating not working

Linear Interpolating rotating not working
0.0 0


So I’ve got a large sprite, 609x528.

I’m attempting to rotate it little by little (to make it look like it’s smoothly rotating) with linear interpolation.

I’ve got linear interpolation working else where with moving the position and I even tried the rotation lerping on that object and it works.

But for some reason, with this large object, it doesn’t want to work.

Here’s my lerp:

float Lerp(float fStart, float fEnd, float fPercent)
    return fStart + ((fEnd - fStart) * fPercent);

And in the TouchesEnded I’ve set m_nRot = 1 from m_nRot = 0 to make it start moving.

In the update I’ve got this:

if(m_nRot == 1)
    if(dt >= .06f)
        m_fRotPer += .1f;
        m_fRotLerp = Lerp(0, 120, m_fRotPer);
        if(m_fRotPer >= 1.0f)
            m_fRotPer = 0.0f;
            m_nRot = 0;

It seems that when I step through it, it will rotate but if I just let it run, it’ll do nothing.

I’m at a loss on why this is happening.


Figured it out. Stupid me made the if check for deltaTime being >= .06f.

Made it .016f and it works fine.