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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user