17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 02:49:19 +02:00

fix(editor): platform edge by the points of a switch keeps the setback of the diverging path, the sample at the points counted with the line leading into the switch

This commit is contained in:
maj00r
2026-10-08 01:48:41 +02:00
parent a5ade3258f
commit 2626c8c86b
2 changed files with 17 additions and 2 deletions

View File

@@ -611,7 +611,7 @@ void sweep_node::beside_switches(std::vector<sample> &Samples)
if (heading > 0.0)
{
for (auto const &sample : Samples)
if (sample.station >= s0 - outer_reach && sample.station < s0 - 1e-3)
if (sample.station >= s0 - outer_reach && sample.station <= s0 + 1e-3)
{
station = sample.station;
chain.push_back(sample);
@@ -650,7 +650,7 @@ void sweep_node::beside_switches(std::vector<sample> &Samples)
nearest = &point;
}
}
if (nearest == nullptr || closest > sample_spacing)
if (nearest == nullptr || closest > 1.5 * sample_spacing)
continue;
auto const offset{sign * glm::dot(glm::dvec3{nearest->position.x - here.position.x, 0.0, nearest->position.z - here.position.z}, glm::dvec3{-forward.z, 0.0, forward.x})};
if (offset > 0.05)