fix devide by zero in texture viewer when construct orientation matrix (#1825)

This commit is contained in:
Kitchen 2019-07-22 11:45:37 +08:00 committed by Бранимир Караџић
parent e14c077b32
commit 4941a3d81c

View File

@ -1095,7 +1095,7 @@ struct InterpolatorT
const double freq = double(bx::getHPFrequency() );
int64_t now = bx::getHPCounter();
float time = (float)(double(now - offset) / freq);
float lerp = bx::clamp(time, 0.0f, duration) / duration;
float lerp = duration != 0 ? bx::clamp(time, 0.0f, duration) / duration : 0.0f;
return lerpT(from, to, easeT(lerp) );
}