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

feat(editor): switch drive placed with a switch leans with the grade and the cant of the track at the points, raised as the simulation raises a canted track

This commit is contained in:
maj00r
2026-10-08 01:53:34 +02:00
parent 095dae91b6
commit 898b4fcaf7
6 changed files with 52 additions and 3 deletions

View File

@@ -644,7 +644,7 @@ std::string compose_directive(std::string const &File, std::vector<std::string>
return text + " end";
}
std::string directive(std::string const &File, include_info const &Info, int const Parameters, glm::dvec3 const &Location, std::optional<float> Yaw, std::string const &Track)
std::string directive(std::string const &File, include_info const &Info, int const Parameters, glm::dvec3 const &Location, std::optional<float> Yaw, std::string const &Track, glm::dvec2 const &Tilt)
{
std::vector<std::string> values;
for (auto id = 1; id <= Parameters; ++id)
@@ -668,6 +668,14 @@ std::string directive(std::string const &File, include_info const &Info, int con
{
value = number(*Yaw);
}
else if (role == "rot.x" && Tilt.x != 0.0)
{
value = number(Tilt.x);
}
else if (role == "rot.z" && Tilt.y != 0.0)
{
value = number(Tilt.y);
}
else if (role.starts_with("rot.") && value.empty())
{
value = "0";