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

refactor(editor): anchor on the nearest place of a path

This commit is contained in:
maj00r
2026-10-04 00:51:05 +02:00
parent 07994a578c
commit 7d87fef7a0
3 changed files with 13 additions and 12 deletions

View File

@@ -222,6 +222,14 @@ double heading(glm::dvec2 const &Forward)
return glm::degrees(std::atan2(Forward.x, Forward.y));
}
anchor make_anchor(TTrack *Track, int const Path, glm::dvec3 const &Point)
{
double s;
bool interior;
project(Track->m_paths[Path], Point, s, interior);
return make_anchor({Track, Path, s}, Point);
}
anchor make_anchor(station const &At, glm::dvec3 const &Point)
{
anchor result;