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

feat(editor): track laid on past the diverging end of a switch keeps the cant of its end along with its radius and grade

This commit is contained in:
maj00r
2026-10-08 01:54:29 +02:00
parent 898b4fcaf7
commit 01949425ac

View File

@@ -4074,7 +4074,10 @@ std::vector<segment_data> editor_mode::extend_pieces() const
auto const angle{geometry::signed_angle(plan_of(tool.point) - centre, plan_of(tool.mouse) - centre) * side};
if (angle * radius < 0.5)
return result;
return arc_pieces(tool.point, direction, tool.grade, radius, std::min(angle, glm::pi<double>()), side);
auto pieces{arc_pieces(tool.point, direction, tool.grade, radius, std::min(angle, glm::pi<double>()), side)};
for (auto &piece : pieces)
piece.rolls = {diverging.rolls[1], diverging.rolls[1]};
return pieces;
}
}
glm::dvec2 const offset{tool.mouse.x - tool.point.x, tool.mouse.z - tool.point.z};