16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 17:59:18 +02:00

build 181216. increased coupler disconnection working range, guaranteed freespot visibility range, optional alternate rotation event mode, ai vehicle startup logic enhancement, minor bug fixes

This commit is contained in:
tmj-fstate
2018-12-17 01:41:38 +01:00
parent f56a2b67be
commit 14c1e89209
11 changed files with 161 additions and 142 deletions

View File

@@ -2588,7 +2588,8 @@ opengl_renderer::Render( TSubModel *Submodel ) {
// material configuration:
Bind_Material( null_handle );
// limit impact of dense fog on the lights
::glFogf( GL_FOG_DENSITY, static_cast<GLfloat>( 1.0 / std::min<float>( Global.fFogEnd, m_fogrange * 2 ) ) );
auto const lightrange { std::max<float>( 500, m_fogrange * 2 ) }; // arbitrary, visibility at least 750m
::glFogf( GL_FOG_DENSITY, static_cast<GLfloat>( 1.0 / lightrange ) );
::glPushAttrib( GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_POINT_BIT );
::glDisable( GL_LIGHTING );
@@ -3123,7 +3124,8 @@ opengl_renderer::Render_Alpha( TAnimModel *Instance ) {
void
opengl_renderer::Render_Alpha( TTraction *Traction ) {
/*
// NOTE: test disabled as this call is only executed as part of the colour pass
double distancesquared;
switch( m_renderpass.draw_mode ) {
case rendermode::shadows: {
@@ -3136,6 +3138,8 @@ opengl_renderer::Render_Alpha( TTraction *Traction ) {
break;
}
}
*/
auto const distancesquared { glm::length2( ( Traction->location() - m_renderpass.camera.position() ) / (double)Global.ZoomFactor ) / Global.fDistanceFactor };
if( ( distancesquared < Traction->m_rangesquaredmin )
|| ( distancesquared >= Traction->m_rangesquaredmax ) ) {
return;
@@ -3184,7 +3188,8 @@ void
opengl_renderer::Render_Alpha( scene::lines_node const &Lines ) {
auto const &data { Lines.data() };
/*
// NOTE: test disabled as this call is only executed as part of the colour pass
double distancesquared;
switch( m_renderpass.draw_mode ) {
case rendermode::shadows: {
@@ -3197,6 +3202,8 @@ opengl_renderer::Render_Alpha( scene::lines_node const &Lines ) {
break;
}
}
*/
auto const distancesquared { glm::length2( ( data.area.center - m_renderpass.camera.position() ) / (double)Global.ZoomFactor ) / Global.fDistanceFactor };
if( ( distancesquared < data.rangesquared_min )
|| ( distancesquared >= data.rangesquared_max ) ) {
return;