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

build 180923. basic precipitation visualization system, minor bug fixes

This commit is contained in:
tmj-fstate
2018-09-23 19:13:33 +02:00
parent 2448e59dc8
commit e1b20a025a
19 changed files with 495 additions and 79 deletions

View File

@@ -2014,7 +2014,7 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
auto const indexstart { 1 };
auto const indexend { ActPar.find_first_not_of( "1234567890", indexstart ) };
auto const huntingchance { std::atoi( ActPar.substr( indexstart, indexend ).c_str() ) };
MoverParameters->TruckHunting = ( Random( 0, 100 ) <= huntingchance );
MoverParameters->TruckHunting = ( Random( 0, 100 ) < huntingchance );
ActPar.erase( 0, indexend );
break;
}
@@ -2396,12 +2396,12 @@ void TDynamicObject::Move(double fDistance)
// normalizacja potrzebna z powodu pochylenia (vFront)
vUp = CrossProduct(vFront, vLeft); // wektor w górę, będzie jednostkowy
modelRot.z = atan2(-vFront.x, vFront.z); // kąt obrotu pojazdu [rad]; z ABuBogies()
double a = ((Axle1.GetRoll() + Axle0.GetRoll())); // suma przechyłek
if (a != 0.0)
auto const roll { Roll() }; // suma przechyłek
if (roll != 0.0)
{ // wyznaczanie przechylenia tylko jeśli jest przechyłka
// można by pobrać wektory normalne z toru...
mMatrix.Identity(); // ta macierz jest potrzebna głównie do wyświetlania
mMatrix.Rotation(a * 0.5, vFront); // obrót wzdłuż osi o przechyłkę
mMatrix.Rotation(roll * 0.5, vFront); // obrót wzdłuż osi o przechyłkę
vUp = mMatrix * vUp; // wektor w górę pojazdu (przekręcenie na przechyłce)
// vLeft=mMatrix*DynamicObject->vLeft;
// vUp=CrossProduct(vFront,vLeft); //wektor w górę
@@ -2838,7 +2838,7 @@ bool TDynamicObject::Update(double dt, double dt1)
// TTrackParam tp;
tp.Width = MyTrack->fTrackWidth;
// McZapkie-250202
tp.friction = MyTrack->fFriction * Global.fFriction;
tp.friction = MyTrack->fFriction * Global.fFriction * Global.FrictionWeatherFactor;
tp.CategoryFlag = MyTrack->iCategoryFlag & 15;
tp.DamageFlag = MyTrack->iDamageFlag;
tp.QualityFlag = MyTrack->iQualityFlag;