16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 21:49:19 +02:00

reformat: use auto on certain types

This commit is contained in:
jerrrrycho
2026-07-04 05:22:52 +02:00
parent f61068ff89
commit 20e7a99516
118 changed files with 2118 additions and 2063 deletions

View File

@@ -193,8 +193,8 @@ double TSegment::RombergIntegral(double const fA, double const fB) const
double TSegment::GetTFromS(double const s) const
{
// initial guess for Newton's method
double fTolerance = 0.001;
double fRatio = s / RombergIntegral(0, 1);
const double fTolerance = 0.001;
const double fRatio = s / RombergIntegral(0, 1);
double fTime = std::lerp( 0.0, 1.0, fRatio );
int iteration = 0;
@@ -295,10 +295,10 @@ const double fDirectionOffset = 0.1; // długość wektora do wyliczenia kierunk
glm::dvec3 TSegment::GetDirection(double const fDistance) const
{ // takie toporne liczenie pochodnej dla podanego dystansu od Point1
double t1 = GetTFromS(fDistance - fDirectionOffset);
const double t1 = GetTFromS(fDistance - fDirectionOffset);
if (t1 <= 0.0)
return CPointOut - Point1; // na zewnątrz jako prosta
double t2 = GetTFromS(fDistance + fDirectionOffset);
const double t2 = GetTFromS(fDistance + fDirectionOffset);
if (t2 >= 1.0)
return Point1 - CPointIn; // na zewnątrz jako prosta
return FastGetPoint(t2) - FastGetPoint(t1);
@@ -306,10 +306,10 @@ glm::dvec3 TSegment::GetDirection(double const fDistance) const
glm::dvec3 TSegment::FastGetDirection(double fDistance, double fOffset)
{ // takie toporne liczenie pochodnej dla parametru 0.0÷1.0
double t1 = fDistance - fOffset;
const double t1 = fDistance - fOffset;
if (t1 <= 0.0)
return CPointOut - Point1; // wektor na początku jest stały
double t2 = fDistance + fOffset;
const double t2 = fDistance + fOffset;
if (t2 >= 1.0)
return Point2 - CPointIn; // wektor na końcu jest stały
return FastGetPoint(t2) - FastGetPoint(t1);