1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00

Take TOBJ data into account when building render lists

This commit is contained in:
Mischa Aster Alff 2016-08-28 13:53:04 +02:00
parent 6fdcf3ab67
commit 397e8ecba8

View File

@ -196,6 +196,21 @@ void ObjectRenderer::renderInstance(InstanceObject *instance,
return;
}
// Handles times provided by TOBJ data
if (instance->object->timeOn != 0 || instance->object->timeOff != 0)
{
const auto currentHour = m_world->getHour();
if (instance->object->timeOff < instance->object->timeOn)
{
if ( currentHour >= instance->object->timeOff && currentHour < instance->object->timeOn )
return;
} else {
if ( currentHour >= instance->object->timeOff || currentHour < instance->object->timeOn )
return;
}
}
auto matrixModel = instance->getTimeAdjustedTransform(m_renderAlpha);
float mindist = glm::length(instance->getPosition()-m_camera.position)