mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 01:19:18 +02:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
54
DynObj.h
54
DynObj.h
@@ -24,7 +24,6 @@ http://mozilla.org/MPL/2.0/.
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
int const ANIM_TYPES = 7; // Ra: ilość typów animacji
|
||||
int const ANIM_WHEELS = 0; // koła
|
||||
int const ANIM_DOORS = 1; // drzwi
|
||||
int const ANIM_LEVERS = 2; // elementy obracane (wycieraczki, koła skrętne, przestawiacze, klocki ham.)
|
||||
@@ -32,6 +31,9 @@ int const ANIM_BUFFERS = 3; // elementy przesuwane (zderzaki)
|
||||
int const ANIM_BOOGIES = 4; // wózki (są skręcane w dwóch osiach)
|
||||
int const ANIM_PANTS = 5; // pantografy
|
||||
int const ANIM_STEAMS = 6; // napęd parowozu
|
||||
int const ANIM_DOORSTEPS = 7;
|
||||
int const ANIM_MIRRORS = 8;
|
||||
int const ANIM_TYPES = 9; // Ra: ilość typów animacji
|
||||
|
||||
class TAnim;
|
||||
//typedef void(__closure *TUpdate)(TAnim *pAnim); // typ funkcji aktualizującej położenie submodeli
|
||||
@@ -104,7 +106,14 @@ class TAnimPant
|
||||
class TAnim
|
||||
{ // klasa animowanej części pojazdu (koła, drzwi, pantografy, burty, napęd parowozu, siłowniki
|
||||
// itd.)
|
||||
public:
|
||||
public:
|
||||
// constructor
|
||||
TAnim() = default;
|
||||
// destructor
|
||||
~TAnim();
|
||||
// methods
|
||||
int TypeSet( int i, int fl = 0 ); // ustawienie typu
|
||||
// members
|
||||
union
|
||||
{
|
||||
TSubModel *smAnimated; // animowany submodel (jeśli tylko jeden, np. oś)
|
||||
@@ -126,16 +135,15 @@ class TAnim
|
||||
int *iIntBase; // jakiś int w fizyce
|
||||
};
|
||||
// void _fastcall Update(); //wskaźnik do funkcji aktualizacji animacji
|
||||
int iFlags; // flagi animacji
|
||||
int iFlags{ 0 }; // flagi animacji
|
||||
float fMaxDist; // do jakiej odległości wykonywana jest animacja
|
||||
float fSpeed; // parametr szybkości animacji
|
||||
int iNumber; // numer kolejny obiektu
|
||||
public:
|
||||
TAnim();
|
||||
~TAnim();
|
||||
|
||||
TUpdate yUpdate; // metoda TDynamicObject aktualizująca animację
|
||||
int TypeSet(int i, int fl = 0); // ustawienie typu
|
||||
/*
|
||||
void Parovoz(); // wykonanie obliczeń animacji
|
||||
*/
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -216,16 +224,15 @@ public:
|
||||
*Material() const {
|
||||
return &m_materialdata; }
|
||||
// tymczasowo udostępnione do wyszukiwania drutu
|
||||
int iAnimType[ ANIM_TYPES ]; // 0-osie,1-drzwi,2-obracane,3-zderzaki,4-wózki,5-pantografy,6-tłoki
|
||||
std::array<int, ANIM_TYPES> iAnimType{ 0 }; // 0-osie,1-drzwi,2-obracane,3-zderzaki,4-wózki,5-pantografy,6-tłoki
|
||||
private:
|
||||
int iAnimations; // liczba obiektów animujących
|
||||
/*
|
||||
TAnim *pAnimations; // obiekty animujące (zawierają wskaźnik do funkcji wykonującej animację)
|
||||
*/
|
||||
std::vector<TAnim> pAnimations;
|
||||
TSubModel ** pAnimated; // lista animowanych submodeli (może być ich więcej niż obiektów animujących)
|
||||
double dWheelAngle[3]; // kąty obrotu kół: 0=przednie toczne, 1=napędzające i wiązary, 2=tylne toczne
|
||||
/*
|
||||
void UpdateNone(TAnim *pAnim){}; // animacja pusta (funkcje ustawiania submodeli, gdy blisko kamery)
|
||||
*/
|
||||
void UpdateAxle(TAnim *pAnim); // animacja osi
|
||||
void UpdateBoogie(TAnim *pAnim); // animacja wózka
|
||||
void UpdateDoorTranslate(TAnim *pAnim); // animacja drzwi - przesuw
|
||||
@@ -233,10 +240,15 @@ private:
|
||||
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
|
||||
void UpdateDoorPlug(TAnim *pAnim); // animacja drzwi - odskokowo-przesuwne
|
||||
void UpdatePant(TAnim *pAnim); // animacja pantografu
|
||||
void UpdatePlatformTranslate(TAnim *pAnim); // doorstep animation, shift
|
||||
void UpdatePlatformRotate(TAnim *pAnim); // doorstep animation, rotate
|
||||
void UpdateMirror(TAnim *pAnim); // mirror animation
|
||||
/*
|
||||
void UpdateLeverDouble(TAnim *pAnim); // animacja gałki zależna od double
|
||||
void UpdateLeverFloat(TAnim *pAnim); // animacja gałki zależna od float
|
||||
void UpdateLeverInt(TAnim *pAnim); // animacja gałki zależna od int (wartość)
|
||||
void UpdateLeverEnum(TAnim *pAnim); // animacja gałki zależna od int (lista kątów)
|
||||
*/
|
||||
void toggle_lights(); // switch light levels for registered interior sections
|
||||
private: // Ra: ciąg dalszy animacji, dopiero do ogarnięcia
|
||||
// ABuWozki 060504
|
||||
@@ -256,8 +268,14 @@ private:
|
||||
public:
|
||||
TAnim *pants; // indeks obiektu animującego dla pantografu 0
|
||||
double NoVoltTime; // czas od utraty zasilania
|
||||
float DoorDelayL{ 0.f }; // left side door closing delay timer
|
||||
float DoorDelayR{ 0.f }; // right side door closing delay timer
|
||||
double dDoorMoveL; // NBMX
|
||||
double dDoorMoveR; // NBMX
|
||||
double dDoorstepMoveL{ 0.0 };
|
||||
double dDoorstepMoveR{ 0.0 };
|
||||
double dMirrorMoveL{ 0.0 };
|
||||
double dMirrorMoveR{ 0.0 };
|
||||
TSubModel *smBrakeSet; // nastawa hamulca (wajcha)
|
||||
TSubModel *smLoadSet; // nastawa ładunku (wajcha)
|
||||
TSubModel *smWiper; // wycieraczka (poniekąd też wajcha)
|
||||
@@ -290,6 +308,8 @@ private:
|
||||
struct door_sounds {
|
||||
sound_source rsDoorOpen { sound_placement::general, 25.f }; // Ra: przeniesione z kabiny
|
||||
sound_source rsDoorClose { sound_placement::general, 25.f };
|
||||
sound_source step_open { sound_placement::general, 25.f };
|
||||
sound_source step_close { sound_placement::general, 25.f };
|
||||
};
|
||||
|
||||
struct exchange_sounds {
|
||||
@@ -391,8 +411,10 @@ private:
|
||||
bool bBrakeAcc { false };
|
||||
sound_source rsPisk { sound_placement::external, EU07_SOUND_BRAKINGCUTOFFRANGE }; // McZapkie-260302
|
||||
sound_source rsUnbrake { sound_placement::external }; // yB - odglos luzowania
|
||||
float m_lastbrakepressure { -1.f }; // helper, cached level of pressure in brake cylinder
|
||||
float m_brakepressurechange { 0.f }; // recent change of pressure in brake cylinder
|
||||
sound_source m_brakecylinderpistonadvance { sound_placement::external };
|
||||
sound_source m_brakecylinderpistonrecede { sound_placement::external };
|
||||
float m_lastbrakepressure { -1.f }; // helper, cached level of pressure in the brake cylinder
|
||||
float m_brakepressurechange { 0.f }; // recent change of pressure in the brake cylinder
|
||||
sound_source sReleaser { sound_placement::external };
|
||||
sound_source rsSlippery { sound_placement::external, EU07_SOUND_BRAKINGCUTOFFRANGE }; // moved from cab
|
||||
sound_source sSand { sound_placement::external };
|
||||
@@ -403,6 +425,7 @@ private:
|
||||
sound_source sDepartureSignal { sound_placement::general };
|
||||
sound_source sHorn1 { sound_placement::external, 5 * EU07_SOUND_RUNNINGNOISECUTOFFRANGE };
|
||||
sound_source sHorn2 { sound_placement::external, 5 * EU07_SOUND_RUNNINGNOISECUTOFFRANGE };
|
||||
sound_source sHorn3 { sound_placement::external, 5 * EU07_SOUND_RUNNINGNOISECUTOFFRANGE };
|
||||
std::vector<sound_source> m_bogiesounds; // TBD, TODO: wrapper for all bogie-related sounds (noise, brakes, squeal etc)
|
||||
sound_source m_wheelflat { sound_placement::external, EU07_SOUND_RUNNINGNOISECUTOFFRANGE };
|
||||
sound_source rscurve { sound_placement::external, EU07_SOUND_RUNNINGNOISECUTOFFRANGE }; // youBy
|
||||
@@ -600,6 +623,11 @@ public:
|
||||
// legacy method, sends list of vehicles over network
|
||||
void
|
||||
DynamicList( bool const Onlycontrolled = false ) const;
|
||||
|
||||
private:
|
||||
// maintenance; removes from tracks consists with vehicles marked as disabled
|
||||
bool
|
||||
erase_disabled();
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user