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

fix(editor): no path of a few millimetres laid by the route design, and no camera at no finite place: an arc of a compound curve squeezed to almost nothing in the plan (a share of 0.00002) made pieces of a few millimetres, which the simulation takes for paths of no length (Bad track: zero length spline, it measures a path in steps of 5 cm), laid as tracks with kinks at their joints. alignment::pieces gives such a stretch to the piece next to it, the one between the same joints if there's one, so no piece is shorter than 10 cm, and a piece of no finite length isn't split for ever. A zoom with the wheel aimed at a point which isn't a number doesn't move the camera, and a camera gone to no finite place goes back to where it last was: right after such tracks were laid the graphics driver hung (TDR) and the whole machine froze. A unit test cuts 4000 compound curves of random arcs, transitions and shares into pieces, as the plan lays them over the paths there and all over again, and finds none under 5 cm

This commit is contained in:
maj00r
2026-10-25 17:26:16 +01:00
parent aca659754b
commit 34bd7c853e
4 changed files with 109 additions and 1 deletions

View File

@@ -214,6 +214,10 @@ class editor_mode : public application_mode, private editor_track::observer, pri
glm::vec3 m_focus_target_angle{0.0f}; // camera pitch/yaw/roll facing the focused object
double m_focus_time{0.0};
double m_focus_duration{0.6};
// the last place and angles of the camera which were numbers: a camera gone to no finite place goes back there
glm::dvec3 m_camera_finite_pos{0.0, 0.0, 0.0};
glm::vec3 m_camera_finite_angle{0.0f};
bool m_camera_finite{false};
double fTime50Hz{0.0}; // bufor czasu dla komunikacji z PoKeys
scene::basic_editor m_editor;