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

hint parallel snap while shifting a straight

This commit is contained in:
maj00r
2026-10-08 21:59:36 +02:00
parent 4d7f5f0f0c
commit 7618dcda59
4 changed files with 103 additions and 14 deletions

View File

@@ -617,6 +617,16 @@ class editor_mode : public application_mode, private editor_track::observer
void apply_detour();
std::vector<glm::dvec3> detour_outline() const;
void find_neighbour_straights();
// listed spacing of a neighbouring straight the line can snap to, if it is close enough
struct parallel_offer
{
bool near{false};
bool snaps{false};
double spacing{0.0};
double distance{0.0};
editor_track::straight const *neighbour{nullptr};
};
parallel_offer straight_parallel_offer(editor_track::straight const &Line, glm::dvec3 const &Offset) const;
glm::dvec3 snap_straight_offset(editor_track::straight const &Line, glm::dvec3 const &Offset) const;
glm::dvec3 snap_straight_direction(glm::dvec3 const &Pivot, glm::dvec3 const &Moved) const;
straights_state m_straights;