mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-19 01:29:21 +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:
@@ -44,6 +44,7 @@ using geometry::bezier;
|
||||
using geometry::chord_length;
|
||||
using geometry::cross;
|
||||
using geometry::plan_of;
|
||||
using geometry::reversed;
|
||||
using geometry::signed_angle;
|
||||
using geometry::turned;
|
||||
|
||||
@@ -94,17 +95,6 @@ double path_radius(segment_data const &Path, double const T)
|
||||
return curvature > 1e-7 ? 1.0 / curvature : 0.0;
|
||||
}
|
||||
|
||||
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 adjoining_direction(TTrack const *Neighbour, glm::dvec3 const &Joint, bool const Leaving, glm::dvec3 &Direction, double &Radius)
|
||||
{
|
||||
if (Neighbour == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user