mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-28 23:57:28 +01:00
refactor(editor): anchor on the nearest place of a path
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -83,6 +83,8 @@ struct anchor
|
||||
double length{0.0};
|
||||
};
|
||||
anchor make_anchor(station const &At, glm::dvec3 const &Point);
|
||||
// anchor at the place of the path nearest to the point
|
||||
anchor make_anchor(TTrack *Track, int const Path, glm::dvec3 const &Point);
|
||||
// location for the current geometry of the path
|
||||
glm::dvec3 place(anchor &Anchor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user