mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user