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

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-04-06 22:33:08 +02:00
13 changed files with 908 additions and 806 deletions

22
World.h
View File

@@ -109,7 +109,10 @@ TWorld();
void radio_message( sound_source *Message, int const Channel );
void CabChange( TDynamicObject *old, TDynamicObject *now );
void TrainDelete(TDynamicObject *d = NULL);
TTrain* train() { return Train; }
TTrain const *
train() const { return Train; }
TDynamicObject const *
controlled() const { return Controlled; }
// switches between static and dynamic daylight calculation
void ToggleDaylight();
// calculates current season of the year based on set simulation date
@@ -122,7 +125,6 @@ TWorld();
private:
void Update_Environment();
void Update_Camera( const double Deltatime );
void Update_UI();
void ResourceSweep();
// handles vehicle change flag
void ChangeDynamic();
@@ -134,21 +136,19 @@ private:
TCamera DebugCamera;
world_environment Environment;
TTrain *Train;
TDynamicObject *pDynamicNearest;
bool Paused{ true };
TDynamicObject *Controlled { nullptr }; // pojazd, który prowadzimy
TDynamicObject *pDynamicNearest { nullptr };
bool Paused { true };
TEvent *KeyEvents[10]; // eventy wyzwalane z klawiaury
TMoverParameters *mvControlled; // wskaźnik na człon silnikowy, do wyświetlania jego parametrów
double fTime50Hz; // bufor czasu dla komunikacji z PoKeys
double fTimeBuffer; // bufor czasu aktualizacji dla stałego kroku fizyki
double fMaxDt; //[s] krok czasowy fizyki (0.01 dla normalnych warunków)
double m_primaryupdaterate{ 1.0 / 100.0 };
double m_secondaryupdaterate{ 1.0 / 50.0 };
double m_primaryupdateaccumulator{ m_secondaryupdaterate }; // keeps track of elapsed simulation time, for core fixed step routines
double m_secondaryupdateaccumulator{ m_secondaryupdaterate }; // keeps track of elapsed simulation time, for less important fixed step routines
double const m_primaryupdaterate { 1.0 / 100.0 };
double const m_secondaryupdaterate { 1.0 / 50.0 };
double m_primaryupdateaccumulator { m_secondaryupdaterate }; // keeps track of elapsed simulation time, for core fixed step routines
double m_secondaryupdateaccumulator { m_secondaryupdaterate }; // keeps track of elapsed simulation time, for less important fixed step routines
int iPause; // wykrywanie zmian w zapauzowaniu
double VelPrev; // poprzednia prędkość
int tprev; // poprzedni czas
double Acc; // przyspieszenie styczne
bool m_init { false }; // indicates whether initial update of the world was performed
GLFWwindow *window;
};