mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
universal controller configuration fix, opengl 3.3 renderer headlights cone tweak
This commit is contained in:
@@ -611,7 +611,7 @@ struct TUniversalCtrl
|
|||||||
int NextPosFastInc = 0; /*nastepna duza pozycja przy przechodzeniu szybkim*/
|
int NextPosFastInc = 0; /*nastepna duza pozycja przy przechodzeniu szybkim*/
|
||||||
int PrevPosFastDec = 0; /*poprzednia duza pozycja przy przechodzeniu szybkim*/
|
int PrevPosFastDec = 0; /*poprzednia duza pozycja przy przechodzeniu szybkim*/
|
||||||
};
|
};
|
||||||
typedef TUniversalCtrl TUniversalCtrlTable[UniversalCtrlArraySize + 1]; /*tablica sterowania uniwersalnego nastawnika*/
|
using TUniversalCtrlTable = std::array< TUniversalCtrl, UniversalCtrlArraySize + 1>;
|
||||||
|
|
||||||
struct TSecuritySystem
|
struct TSecuritySystem
|
||||||
{
|
{
|
||||||
@@ -1059,6 +1059,7 @@ public:
|
|||||||
bool UniCtrlIntegratedBrakePNCtrl = false; /*zintegrowany nastawnik JH obsluguje hamulec PN*/
|
bool UniCtrlIntegratedBrakePNCtrl = false; /*zintegrowany nastawnik JH obsluguje hamulec PN*/
|
||||||
bool UniCtrlIntegratedBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie*/
|
bool UniCtrlIntegratedBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie*/
|
||||||
bool UniCtrlIntegratedLocalBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie hamulcem pomocniczym*/
|
bool UniCtrlIntegratedLocalBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie hamulcem pomocniczym*/
|
||||||
|
int UniCtrlNoPowerPos{ 0 }; // cached highesr position not generating traction force
|
||||||
|
|
||||||
/*-sekcja parametrow dla lokomotywy elektrycznej*/
|
/*-sekcja parametrow dla lokomotywy elektrycznej*/
|
||||||
TSchemeTable RList; /*lista rezystorow rozruchowych i polaczen silnikow, dla dizla: napelnienia*/
|
TSchemeTable RList; /*lista rezystorow rozruchowych i polaczen silnikow, dla dizla: napelnienia*/
|
||||||
|
|||||||
@@ -2189,7 +2189,7 @@ int TMoverParameters::MainCtrlNoPowerPos() const {
|
|||||||
switch( EIMCtrlType ) {
|
switch( EIMCtrlType ) {
|
||||||
case 1: { return 3; }
|
case 1: { return 3; }
|
||||||
case 2: { return 3; }
|
case 2: { return 3; }
|
||||||
case 3: { return 3; }
|
case 3: { return UniCtrlNoPowerPos; }
|
||||||
default: { return 0; }
|
default: { return 0; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10653,6 +10653,15 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
|
|||||||
// WriteLogSS("OK=", BoolTo10(OK));
|
// WriteLogSS("OK=", BoolTo10(OK));
|
||||||
// WriteLog("");
|
// WriteLog("");
|
||||||
|
|
||||||
|
if( EIMCtrlType == 3 ) {
|
||||||
|
for( auto idx = 0; idx < MainCtrlPosNo; ++idx ) {
|
||||||
|
if( UniCtrlList[ idx ].MaxCtrlVal > 0.0 ) {
|
||||||
|
UniCtrlNoPowerPos = std::max( 0, ( idx - 1 ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4058,9 +4058,11 @@ void opengl33_renderer::Update_Lights(light_array &Lights)
|
|||||||
auto const &ownerdimensions{ scenelight.owner->MoverParameters->Dim };
|
auto const &ownerdimensions{ scenelight.owner->MoverParameters->Dim };
|
||||||
auto const up{ static_cast<glm::dvec3>( scenelight.owner->VectorUp() ) };
|
auto const up{ static_cast<glm::dvec3>( scenelight.owner->VectorUp() ) };
|
||||||
auto const size{ static_cast<float>( std::max( ownerdimensions.W, ownerdimensions.H ) * 1.0 ) }; // ensure square ratio
|
auto const size{ static_cast<float>( std::max( ownerdimensions.W, ownerdimensions.H ) * 1.0 ) }; // ensure square ratio
|
||||||
|
auto const cone{ 5.f };
|
||||||
|
auto const offset{ 75.f * ( 5.f / cone ) };
|
||||||
headlights.position() =
|
headlights.position() =
|
||||||
scenelight.owner->GetPosition()
|
scenelight.owner->GetPosition()
|
||||||
- scenelight.direction * 150.f
|
- scenelight.direction * offset
|
||||||
+ up * ( size * 0.5 );
|
+ up * ( size * 0.5 );
|
||||||
/*
|
/*
|
||||||
headlights.projection() = ortho_projection(
|
headlights.projection() = ortho_projection(
|
||||||
@@ -4069,9 +4071,9 @@ void opengl33_renderer::Update_Lights(light_array &Lights)
|
|||||||
ownerdimensions.L * 0.5 - 0.5, 1000.0f );
|
ownerdimensions.L * 0.5 - 0.5, 1000.0f );
|
||||||
*/
|
*/
|
||||||
headlights.projection() = perspective_projection(
|
headlights.projection() = perspective_projection(
|
||||||
glm::radians( 2.5 ),
|
glm::radians( cone ),
|
||||||
1.0,
|
1.0,
|
||||||
ownerdimensions.L * 0.5 + 150.0 - 0.25, 1000.0f );
|
ownerdimensions.L * 0.5 + offset - 0.25, 1000.0f );
|
||||||
glm::dmat4 viewmatrix{ 1.0 };
|
glm::dmat4 viewmatrix{ 1.0 };
|
||||||
viewmatrix *=
|
viewmatrix *=
|
||||||
glm::lookAt(
|
glm::lookAt(
|
||||||
|
|||||||
Reference in New Issue
Block a user