17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 06:59:13 +01:00

feat(track): the blades of the switches laid in the editor shaped from their templates with the frogs still whole: the blades alone are on (track_features::blades), the rails cut at the frogs, the wing and the check rails stay off. A switch with the key frogs draws its blades from the tip where their planed nose ends to the heel, bent as they're thrown, the rail behind them from the heel on, where they were laid from the start of the switch before; on a switch of the catalogue they start at the cut tip of the tables, 1.248 m from the joint at R 190, 1.5 m at R 300. The plain track a blade of a double switch runs on into starts its rail behind the heel. The switches without the key, laid by other tools, and the ones of a double slip, whose blades end short of crossings found only with the rails cut, keep the blades they had. The paths the vehicles run on don't change

This commit is contained in:
maj00r
2026-10-26 20:40:28 +01:00
parent aed2cfad2c
commit 3b43c71dbb
4 changed files with 28 additions and 3 deletions

View File

@@ -1637,7 +1637,13 @@ void TTrack::create_geometry( gfx::geometrybank_handle const &Bank ) {
continue;
}
vertices.clear(); // reuse the scratchpad
Segment->RenderLoft( vertices, m_origin, profile, iTrapezoid > 0, texturelength );
// the rail starts behind the heel of a blade running on into the track from the switch before it
if( auto const runon { eType == tt_Normal && iTrapezoid == 0 ? track_rails::blade_runon( *this, side ) : 0.0 }; runon > 0.0 ) {
Segment->RenderLoftSpan( vertices, m_origin, profile, { .side = side, .halfwidth = 0.5f * std::abs( fTrackWidth ), .texturelength = texturelength, .from = runon, .to = Segment->GetLength() } );
}
else {
Segment->RenderLoft( vertices, m_origin, profile, iTrapezoid > 0, texturelength );
}
if( open ) {
cut_faces( vertices, nnumPts, trPrev == nullptr, trNext == nullptr, GeometryCut1 );
}