build 190902. vehicle derailment, oil pressure change tweak, inverter sound tweak, car braking logic tweak, flashing alerter ui indicator, departure signal sources reduction, additional train state data exposed to uart interface, additional train state data for python scripts, wind simulation tweak, coupler animation fix

This commit is contained in:
tmj-fstate
2019-09-02 19:18:44 +02:00
parent 269e271f01
commit 68a45db21a
16 changed files with 285 additions and 147 deletions

View File

@@ -194,13 +194,17 @@ world_environment::update_wind() {
m_wind.change_time -= timedelta;
if( m_wind.change_time < 0 ) {
m_wind.change_time = Random( 5, 30 );
m_wind.velocity_change = Random( -1, 1 );
if( Random() < 0.2 ) {
m_wind.change_time = Random( 5, 15 );
m_wind.velocity_change = Random( -0.2, 0.2 );
if( Random() < 0.05 ) {
// changes in wind direction should be less frequent than changes in wind speed
// TBD, TODO: configuration-driven direction change frequency
m_wind.azimuth_change = Random( -5, 5 );
}
else {
// keep direction change periods short, to avoid too drastic changes in direction
m_wind.azimuth_change = 0.0;
}
}
// TBD, TODO: wind configuration
m_wind.azimuth = clamp_circular( m_wind.azimuth + m_wind.azimuth_change * timedelta );
@@ -213,9 +217,9 @@ world_environment::update_wind() {
m_wind.vector =
std::max( 0.f, m_wind.velocity )
* glm::vec3(
std::sin( polarangle ) * std::sin( azimuthalangle ),
std::sin( polarangle ) * std::sin( azimuthalangle ) * -1,
std::cos( polarangle ),
std::sin( polarangle ) * std::cos( azimuthalangle ) * -1 );
std::sin( polarangle ) * std::cos( azimuthalangle ) );
}
void