17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 19:52:47 +01:00

Merge branch 'master' into feat/renderers-cleanup

This commit is contained in:
2026-11-07 16:44:51 +01:00
177 changed files with 11657 additions and 833 deletions

View File

@@ -220,6 +220,7 @@ public:
std::vector<TTrack *> m_crossings; // tracks whose rails cross the rails of this one, found when its geometry was made
track_rails::rail_plan m_railplans[ 2 ][ 2 ]; // the cuts of its rails, by path and right side, as its geometry was made
std::vector<glm::dvec2> m_railguards[ 2 ][ 2 ]; // the guard rails inside its rails at the crossings at wide angles, from and to along the path, as its geometry was made
bool m_tributary { false }; // loaded as a tributary: a river of its first path, the second one kept to be written back
scene::basic_node *m_road { nullptr }; // road or road junction which generated this path. such path is one-way, and isn't saved nor edited on its own
std::array<float, 3> m_routeweights { 0.f, 0.f, 0.f }; // odds of each route through a crossroads being picked by a driver, by the number of the route. all zero: even odds
int iterate_stamp = 0;
@@ -415,16 +416,22 @@ public:
// the unevenness the track declares, on a path of a switch
track_uneven::amounts uneven_declared( int const Path = 0 ) const;
bool is_uneven() const;
// the unevenness along what the vehicles take now: the path set on a switch, with what the switches joined and the tracks by them allow
track_uneven::amounts uneven_underway();
// the unevenness at a distance along a path, meeting the tracks joined at its ends
track_uneven::amounts uneven_at( double const Distance, int const Path = 0 ) const;
track_uneven::amounts uneven_at( double const Distance, int const Path = 0 );
// how much of the displacement a point of the profile at the depth takes
double uneven_bed_share( double const Depth ) const;
// closes the gaps and steps of cant between the ends of joined paths
void share_joints();
double joint_depth() const; // mm
double joint_dip( double const Distance ) const; // m
double joint_dip( double const Distance ); // m
// distance from the rail joint behind; negative: the track has no joints that dip
double rail_phase( double const Distance ) const;
double rail_phase( double const Distance );
// whether the rail joints are elsewhere than the geometry of the track has them
bool rail_joints_moved();
// the uneven tracks whose values go by the switches among the given: all the switches joined to those, and the tracks they meet
static std::vector<TTrack *> switch_followers( std::vector<TTrack *> const &Tracks );
void ConnectionsLog();
bool DoubleSlip() const;
static void fetch_default_profiles();
@@ -443,6 +450,8 @@ private:
void deserialize_( std::istream &Input );
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
void export_as_text_( std::ostream &Output ) const;
// the keyword the track is written with, by its type and for a plain one by what runs on it
char const *type_keyword() const;
// locates specified profile in the profile database, potentially loading it from a file
static std::pair<std::string, int> fetch_track_rail_profile( std::string const &Profile );
// loads content of specified file and converts it into a vertex array
@@ -463,8 +472,9 @@ private:
double way { 1.0 }; // direction of the path along the run
int stamp { -1 };
};
void settle_rail_run() const;
mutable rail_run m_railrun;
void settle_rail_run();
rail_run m_railrun;
rail_run m_drawnrun; // as the geometry has it; stamp -1: it has no joints that dip
// the value along each path of a switch: the lowest of that path in the switches joined, 0 next to a track with none.
// And at the ends of the paths, by what meets there: the other path at the common end, the path of a switch joined
struct switch_stray {
@@ -472,16 +482,17 @@ private:
std::array<std::array<track_uneven::amounts, 2>, 2> ends;
int stamp { -1 };
};
mutable switch_stray m_switchstray;
switch_stray const &switch_uneven() const;
void settle_switch_stray() const;
switch_stray m_switchstray;
switch_stray const &switch_uneven();
void settle_switch_stray();
void settle_switch_ends();
// the lowest value of the paths ending at the point
track_uneven::amounts switch_paths_at( glm::dvec3 const &Point ) const;
// what a plain track comes to at its end, where it meets the other one
track_uneven::amounts uneven_met( TTrack const *Other, glm::dvec3 const &Point ) const;
track_uneven::amounts uneven_met( TTrack *Other, glm::dvec3 const &Point ) const;
// the value of a switch where a track joined to it meets it
track_uneven::amounts switch_uneven_at( glm::dvec3 const &Point ) const;
static int s_layoutstamp; // bumped when tracks are joined or changed, invalidates the two above
track_uneven::amounts switch_uneven_at( glm::dvec3 const &Point );
static int s_layoutstamp; // bumped when tracks are joined or changed, invalidates the two above. Once per change: a run is walked again after each
void create_road_profile( gfx::vertex_array &Output, bool const Forcetransition = false );
void create_road_side_profile( gfx::vertex_array &Right, gfx::vertex_array &Left, gfx::vertex_array const &Road, bool const Forcetransition = false );
/// <summary>