17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 12:47:30 +01:00

refactor(track): the rails of the two paths of a switch are laid by one loop for left and right switches alike, the side of the blade of a path and the blade itself come from one place, used when a switch is made, thrown and its frog found

This commit is contained in:
maj00r
2026-10-13 19:03:20 +02:00
parent 809b48c2ab
commit 405081e81c
3 changed files with 47 additions and 111 deletions

View File

@@ -735,7 +735,7 @@ TTrack::switch_frog TTrack::frog() const {
if( eType != tt_Switch || false == cut_rails( *this ) ) {
return result;
}
result.side[ 0 ] = ( SwitchExtension->RightSwitch ? 1 : -1 );
result.side[ 0 ] = blade_side( 0 );
result.side[ 1 ] = -result.side[ 0 ];
auto const halfwidth { 0.5 * std::abs( fTrackWidth ) };
std::vector<glm::dvec2> lines[ 2 ];