mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 09:27:54 +01:00
fix(track): the cab keeps the shake a track doesn't replace, and the editor redraws all that an edit changes
The side sway from the lateral acceleration now goes off only on a track with a sideways value, and the random jolts on one with a vertical or a sideways value. Dips at the rail joints and cross level alone replace neither. On a switch it goes by the path set and what its joined tracks allow. An edit in the editor also rebuilds the other switches of a joined group with the tracks they meet, and the tracks of a rail run whose joints moved. Removing a track does the same. While dragging, the tracks further off wait until the drag ends. The clatter of a bogie's axles was right: the followers stand at the pivots and the offsets are the places of the wheel sets. The misleading name goes. Also what Sonar had left: a parameter as a span, a const method, a struct and its member apart, commented out code, and a function of the grading tool split, with the same output.
This commit is contained in:
@@ -38,6 +38,28 @@ void add_chord(std::vector<double> &Output, std::vector<double> const &Line, int
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_CASE("uneven track: the cab keeps what the ride on the track doesn't stand in for")
|
||||
{
|
||||
auto const replaced = [](double const Up, double const Side, double const Cross) {
|
||||
return track_uneven::replaced_shake({Up, Side, Cross});
|
||||
};
|
||||
// all of it, as "uneven 18"
|
||||
CHECK(replaced(18.0, 18.0, 18.0).sway);
|
||||
CHECK(replaced(18.0, 18.0, 18.0).jolts);
|
||||
// nothing at all, as on a track with dips at its joints alone
|
||||
CHECK_FALSE(replaced(0.0, 0.0, 0.0).sway);
|
||||
CHECK_FALSE(replaced(0.0, 0.0, 0.0).jolts);
|
||||
// up and down only: there is nothing to sway with
|
||||
CHECK_FALSE(replaced(18.0, 0.0, 0.0).sway);
|
||||
CHECK(replaced(18.0, 0.0, 0.0).jolts);
|
||||
// sideways only
|
||||
CHECK(replaced(0.0, 18.0, 0.0).sway);
|
||||
CHECK(replaced(0.0, 18.0, 0.0).jolts);
|
||||
// cross level only turns the body
|
||||
CHECK_FALSE(replaced(0.0, 0.0, 18.0).sway);
|
||||
CHECK_FALSE(replaced(0.0, 0.0, 18.0).jolts);
|
||||
}
|
||||
|
||||
TEST_CASE("uneven track: measures as the Id-14 limits for its value")
|
||||
{
|
||||
// appendix 1, class C at 80 km/h: 18 mm vertically, 17 mm sideways, 16 mm of twist on 5 m, gauge +10/-8 mm, 20 mm of cross level, J = 5.3
|
||||
|
||||
Reference in New Issue
Block a user