Ok, I know that each machine runs at different speeds and will even process the exact same computations within the same machine within different amounts of time. This presents a problem if I want to have smooth (and consistent) movement. Here is how I have been doing it:
void Camera::UpdateTBF(){
newTime=clock();
fTBF=double(newTime-oldTime);
oldTime=newTime;
tbfFactor=fTBF/1000.0;
}
fTBF and tbfFactor are both doubles. newTime and oldTime are longs.
Whenever movement occurs, the amount of movement is multiplied by tbfFactor.
I thought this would work great, but every so often I see "jumps" in movement. So I arbitrarily set tbfFactor to 0.015 (that's about the average for my machine) and I get smooth, consistent movement all the time. What's the deal? I MUST be doing it wrong.....