div by zero fix

This commit is contained in:
Anthony J. Thibault 2017-10-10 16:20:52 -07:00
parent 18d723b6b4
commit cbb0d27f68

View file

@ -55,7 +55,7 @@ void LODManager::autoAdjustLOD(float batchTime, float engineRunTime, float delta
float maxTime = glm::max(renderTime, engineRunTime);
const float BLEND_TIMESCALE = 0.3f; // sec
const float safeDeltaTime = (deltaTime == 0.0f) ? 0.001f : deltaTime;
float blend = BLEND_TIMESCALE / deltaTimeSec;
float blend = BLEND_TIMESCALE / safeDeltaTime;
if (blend > 1.0f) {
blend = 1.0f;
}