mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 08:39:19 +02:00
refactor(editor): split the track mode into its gizmo, kept records, switch drive, switch slide and track bed files; path geometry shared in editorGeometry instead of four copies of the reversed path, track shape rules (stretching, rolls at joints, middle, switch axis, drive spot) in editor_track, fitting the track to the ground in ground_follow with the terrain query passed in, the record layer and the switch classification in the stores; long gizmo, record watch and switch slide functions broken up, out-parameters replaced by optional results
This commit is contained in:
@@ -46,6 +46,7 @@ namespace
|
||||
using geometry::bezier;
|
||||
using geometry::plan_distance;
|
||||
using geometry::plan_of;
|
||||
using geometry::reversed;
|
||||
|
||||
double const kSweepRouteReach{2000.0}; // m each way through the switches
|
||||
double const kSweepOutlineStep{1.0};
|
||||
@@ -114,17 +115,6 @@ bool platform_distance()
|
||||
return true;
|
||||
}
|
||||
|
||||
segment_data reversed(segment_data const &Path)
|
||||
{
|
||||
segment_data result{Path};
|
||||
result.points[segment_data::point::start] = Path.points[segment_data::point::end];
|
||||
result.points[segment_data::point::end] = Path.points[segment_data::point::start];
|
||||
result.points[segment_data::point::control1] = Path.points[segment_data::point::control2];
|
||||
result.points[segment_data::point::control2] = Path.points[segment_data::point::control1];
|
||||
result.rolls = {-Path.rolls[1], -Path.rolls[0]};
|
||||
return result;
|
||||
}
|
||||
|
||||
bool same_piece(segment_data const &A, segment_data const &B)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
|
||||
Reference in New Issue
Block a user