17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 10:50:22 +01:00

Merge remote-tracking branch 'origin/feat/track-uneven' into feat/renderers-cleanup

This commit is contained in:
2026-10-31 18:53:48 +01:00
15 changed files with 807 additions and 6 deletions

View File

@@ -101,6 +101,7 @@ class TSegment
glm::dvec3 Point2;
float fRoll1 { 0.f };
float fRoll2 { 0.f }; // przechyłka na końcach
bool m_uneven { false }; // see TrackUneven.h
double fLength { -1.0 }; // długość policzona
std::vector<double> fTsBuffer; // wartości parametru krzywej t dla równych odcinków s
std::vector<double> fTsSlope; // nachylenie dt/du (= dt/ds * fStep) w tych samych punktach
@@ -131,6 +132,12 @@ class TSegment
// the vertex of a profile lofted at the point and across the path there, turned from the baked roll to the one of the path at the distance
void roll_vertex( gfx::basic_vertex &Vertex, glm::vec3 const &Position, glm::vec3 const &Parallel, double const Distance ) const;
// moves a lofted vertex with the unevenness of the track
void settle_vertex( gfx::basic_vertex &Vertex, glm::dvec3 const &Origin, glm::vec3 const &Position, glm::vec3 const &Parallel, double const Distance ) const;
// displacement of a point by the unevenness, at a distance along the path
glm::dvec3 stray( glm::dvec3 const &Point, double const Distance ) const;
void design_position( double const fDistance, glm::dvec3 &position, glm::vec3 &rotation ) const;
public:
bool bCurve = false;
@@ -179,6 +186,13 @@ public:
/// <param name="position">Calculated position</param>
/// <param name="rotation">Calculated rotation</param>
void RaPositionGet(double const fDistance, glm::dvec3 &position, glm::vec3 &rotation) const;
// call before Init, it sets the density of the geometry
void
set_uneven( bool const Uneven ) {
m_uneven = Uneven; }
// second derivative of the displacement along the path; times speed squared: acceleration of an axle
glm::dvec3
uneven_bend( double const Distance ) const;
glm::dvec3 FastGetPoint(double const t) const;
inline
glm::dvec3