mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
build 170509. minor fixes for pantograph logic and speed table calculations
This commit is contained in:
11
Driver.cpp
11
Driver.cpp
@@ -226,6 +226,15 @@ bool TSpeedPos::Update(vector3 *p, vector3 *dir, double &len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if( fDist < 50.0 ) {
|
||||||
|
// old sceneries use trick of placing 'helper' semaphores underground, which can lead to vehicles running over them instead of stopping in front of them
|
||||||
|
// to account for it at short distances we redo distance calculation on 2d plane
|
||||||
|
fDist = glm::dot(
|
||||||
|
glm::vec3( v.x, 0.0, v.z ),
|
||||||
|
glm::vec3( dir->x, 0.0, dir->z ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fDist > 0.0) // nie może być 0.0, a przypadkiem mogło by się trafić i było by źle
|
if (fDist > 0.0) // nie może być 0.0, a przypadkiem mogło by się trafić i było by źle
|
||||||
@@ -391,6 +400,8 @@ void TController::TableClear()
|
|||||||
iTableDirection = 0; // nieznany
|
iTableDirection = 0; // nieznany
|
||||||
tLast = nullptr;
|
tLast = nullptr;
|
||||||
fLastVel = -1.0;
|
fLastVel = -1.0;
|
||||||
|
SemNextIndex = -1;
|
||||||
|
SemNextStopIndex = -1;
|
||||||
eSignSkip = nullptr; // nic nie pomijamy
|
eSignSkip = nullptr; // nic nie pomijamy
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2943,8 +2943,11 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
// drop pantographs
|
// drop pantographs
|
||||||
// NOTE: this isn't universal behaviour
|
// NOTE: this isn't universal behaviour
|
||||||
// TODO: have this dependant on .fiz-driven flag
|
// TODO: have this dependant on .fiz-driven flag
|
||||||
|
// NOTE: moved to pantspeed calculation part a little later in the function. all remarks and todo still apply
|
||||||
|
/*
|
||||||
MoverParameters->PantFront( false, ( MoverParameters->TrainType == dt_EZT ? command_range::unit : command_range::local ) );
|
MoverParameters->PantFront( false, ( MoverParameters->TrainType == dt_EZT ? command_range::unit : command_range::local ) );
|
||||||
MoverParameters->PantRear( false, ( MoverParameters->TrainType == dt_EZT ? command_range::unit : command_range::local ) );
|
MoverParameters->PantRear( false, ( MoverParameters->TrainType == dt_EZT ? command_range::unit : command_range::local ) );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3226,6 +3229,10 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
else {
|
else {
|
||||||
pantspeedfactor = 0.0;
|
pantspeedfactor = 0.0;
|
||||||
}
|
}
|
||||||
|
if( ( false == MoverParameters->Battery )
|
||||||
|
&& ( false == MoverParameters->ConverterFlag ) ) {
|
||||||
|
pantspeedfactor = 0.0;
|
||||||
|
}
|
||||||
pantspeedfactor = std::max( 0.0, pantspeedfactor );
|
pantspeedfactor = std::max( 0.0, pantspeedfactor );
|
||||||
k = p->fAngleL;
|
k = p->fAngleL;
|
||||||
if( ( pantspeedfactor > 0.0 )
|
if( ( pantspeedfactor > 0.0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user