mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 11:39:19 +02:00
reformat: remove redundant 'inline' specifier
This commit is contained in:
@@ -50,7 +50,7 @@ class Console
|
|||||||
static int On();
|
static int On();
|
||||||
static void Off();
|
static void Off();
|
||||||
|
|
||||||
inline static bool Pressed(int x)
|
static bool Pressed(int x)
|
||||||
{ // na razie tak - czyta się tylko klawiatura
|
{ // na razie tak - czyta się tylko klawiatura
|
||||||
if (glfwGetKey(Application.window(), x) == GLFW_TRUE)
|
if (glfwGetKey(Application.window(), x) == GLFW_TRUE)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
166
McZapkie/MOVER.h
166
McZapkie/MOVER.h
@@ -1027,7 +1027,7 @@ struct TPowerParameters
|
|||||||
TPowerType PowerType;
|
TPowerType PowerType;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
inline TPowerParameters()
|
TPowerParameters()
|
||||||
{
|
{
|
||||||
MaxVoltage = 0.0;
|
MaxVoltage = 0.0;
|
||||||
MaxCurrent = 0.0;
|
MaxCurrent = 0.0;
|
||||||
@@ -1236,11 +1236,11 @@ struct TCoupling
|
|||||||
bool Render = false; /*ABu: czy rysowac jak zaczepiony sprzeg*/
|
bool Render = false; /*ABu: czy rysowac jak zaczepiony sprzeg*/
|
||||||
std::string control_type; // abstraction of control coupling interface and communication standard
|
std::string control_type; // abstraction of control coupling interface and communication standard
|
||||||
|
|
||||||
inline bool has_adapter() const
|
bool has_adapter() const
|
||||||
{
|
{
|
||||||
return adapter_type != TCouplerType::NoCoupler;
|
return adapter_type != TCouplerType::NoCoupler;
|
||||||
}
|
}
|
||||||
inline TCouplerType const type() const
|
TCouplerType const type() const
|
||||||
{
|
{
|
||||||
return adapter_type == TCouplerType::NoCoupler ? CouplerType : adapter_type;
|
return adapter_type == TCouplerType::NoCoupler ? CouplerType : adapter_type;
|
||||||
}
|
}
|
||||||
@@ -2090,7 +2090,7 @@ class TMoverParameters
|
|||||||
int CabActive = 0; // numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
int CabActive = 0; // numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||||
int CabOccupied = 0; // numer kabiny, w ktorej jest obsada (zwykle jedna na skład) // TODO: move to TController
|
int CabOccupied = 0; // numer kabiny, w ktorej jest obsada (zwykle jedna na skład) // TODO: move to TController
|
||||||
bool CabMaster = false; // czy pojazd jest nadrzędny w składzie
|
bool CabMaster = false; // czy pojazd jest nadrzędny w składzie
|
||||||
inline bool IsCabMaster()
|
bool IsCabMaster()
|
||||||
{
|
{
|
||||||
return CabActive == CabOccupied && CabMaster;
|
return CabActive == CabOccupied && CabMaster;
|
||||||
} // czy aktualna kabina jest na pewno tą, z której można sterować
|
} // czy aktualna kabina jest na pewno tą, z której można sterować
|
||||||
@@ -2293,12 +2293,12 @@ class TMoverParameters
|
|||||||
bool Attach(int ConnectNo, int ConnectToNr, TMoverParameters *ConnectTo, int CouplingType, bool Enforce = false, bool Audible = true);
|
bool Attach(int ConnectNo, int ConnectToNr, TMoverParameters *ConnectTo, int CouplingType, bool Enforce = false, bool Audible = true);
|
||||||
int DettachStatus(int ConnectNo);
|
int DettachStatus(int ConnectNo);
|
||||||
bool Dettach(int ConnectNo);
|
bool Dettach(int ConnectNo);
|
||||||
void damage_coupler(int const End);
|
void damage_coupler(int End);
|
||||||
void Derail(DerailReason Reason);
|
void Derail(DerailReason Reason);
|
||||||
bool DirectionForward();
|
bool DirectionForward();
|
||||||
bool DirectionBackward(void); /*! kierunek ruchu*/
|
bool DirectionBackward(void); /*! kierunek ruchu*/
|
||||||
bool EIMDirectionChangeAllow(void) const;
|
bool EIMDirectionChangeAllow(void) const;
|
||||||
inline double IsVehicleEIMBrakingFactor()
|
double IsVehicleEIMBrakingFactor()
|
||||||
{
|
{
|
||||||
return DynamicBrakeFlag && ResistorsFlag ? 0.0 : eimv[eimv_Ipoj] < 0 ? -1.0 : 1.0;
|
return DynamicBrakeFlag && ResistorsFlag ? 0.0 : eimv[eimv_Ipoj] < 0 ? -1.0 : 1.0;
|
||||||
}
|
}
|
||||||
@@ -2307,19 +2307,19 @@ class TMoverParameters
|
|||||||
bool IncBrakeLevel(); // wersja na użytek AI
|
bool IncBrakeLevel(); // wersja na użytek AI
|
||||||
bool DecBrakeLevel();
|
bool DecBrakeLevel();
|
||||||
bool ChangeCab(int direction);
|
bool ChangeCab(int direction);
|
||||||
bool CurrentSwitch(bool const State);
|
bool CurrentSwitch(bool State);
|
||||||
bool IsMotorOverloadRelayHighThresholdOn() const;
|
bool IsMotorOverloadRelayHighThresholdOn() const;
|
||||||
void UpdateBatteryVoltage(double dt);
|
void UpdateBatteryVoltage(double dt);
|
||||||
double ComputeMovement(double dt, double dt1, const TTrackShape &Shape, TTrackParam &Track, TTractionParam &ElectricTraction, TLocation const &NewLoc,
|
double ComputeMovement(double dt, double dt1, const TTrackShape &Shape, TTrackParam &Track, TTractionParam &ElectricTraction, TLocation const &NewLoc,
|
||||||
TRotation const &NewRot); // oblicza przesuniecie pojazdu
|
TRotation const &NewRot); // oblicza przesuniecie pojazdu
|
||||||
double FastComputeMovement(double dt, const TTrackShape &Shape, TTrackParam &Track, TLocation const &NewLoc, TRotation const &NewRot); // oblicza przesuniecie pojazdu - wersja zoptymalizowana
|
double FastComputeMovement(double dt, const TTrackShape &Shape, TTrackParam &Track, TLocation const &NewLoc, TRotation const &NewRot); // oblicza przesuniecie pojazdu - wersja zoptymalizowana
|
||||||
void compute_movement_(double const Deltatime);
|
void compute_movement_(double Deltatime);
|
||||||
double ShowEngineRotation(int VehN);
|
double ShowEngineRotation(int VehN);
|
||||||
|
|
||||||
// Q *******************************************************************************************
|
// Q *******************************************************************************************
|
||||||
double GetTrainsetVoltage(int const Coupling = heating | highvoltage) const;
|
double GetTrainsetVoltage(int Coupling = heating | highvoltage) const;
|
||||||
double GetTrainsetHighVoltage() const;
|
double GetTrainsetHighVoltage() const;
|
||||||
bool switch_physics(bool const State);
|
bool switch_physics(bool State);
|
||||||
double LocalBrakeRatio(void);
|
double LocalBrakeRatio(void);
|
||||||
double ManualBrakeRatio(void);
|
double ManualBrakeRatio(void);
|
||||||
double PipeRatio(void); /*ile napelniac*/
|
double PipeRatio(void); /*ile napelniac*/
|
||||||
@@ -2330,16 +2330,16 @@ class TMoverParameters
|
|||||||
double EngineMaxRPM() const;
|
double EngineMaxRPM() const;
|
||||||
|
|
||||||
/*! przesylanie komend sterujacych*/
|
/*! przesylanie komend sterujacych*/
|
||||||
bool SendCtrlToNext(std::string const CtrlCommand, double const ctrlvalue, double const dir, int const Couplertype = control);
|
bool SendCtrlToNext(std::string CtrlCommand, double ctrlvalue, double dir, int Couplertype = control);
|
||||||
bool SetInternalCommand(std::string NewCommand, double NewValue1, double NewValue2, int const Couplertype = control);
|
bool SetInternalCommand(std::string NewCommand, double NewValue1, double NewValue2, int Couplertype = control);
|
||||||
double GetExternalCommand(std::string &Command);
|
double GetExternalCommand(std::string &Command);
|
||||||
bool RunCommand(std::string Command, double CValue1, double CValue2, int const Couplertype = control);
|
bool RunCommand(std::string Command, double CValue1, double CValue2, int Couplertype = control);
|
||||||
bool RunInternalCommand();
|
bool RunInternalCommand();
|
||||||
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
|
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
|
||||||
bool CabActivisation(bool const Enforce = false);
|
bool CabActivisation(bool Enforce = false);
|
||||||
bool CabDeactivisation(bool const Enforce = false);
|
bool CabDeactivisation(bool Enforce = false);
|
||||||
bool CabActivisationAuto(bool const Enforce = false);
|
bool CabActivisationAuto(bool Enforce = false);
|
||||||
bool CabDeactivisationAuto(bool const Enforce = false);
|
bool CabDeactivisationAuto(bool Enforce = false);
|
||||||
|
|
||||||
/*! funkcje zwiekszajace/zmniejszajace nastawniki*/
|
/*! funkcje zwiekszajace/zmniejszajace nastawniki*/
|
||||||
/*! glowny nastawnik:*/
|
/*! glowny nastawnik:*/
|
||||||
@@ -2360,16 +2360,16 @@ class TMoverParameters
|
|||||||
|
|
||||||
bool AddPulseForce(int Multipler); /*dla drezyny*/
|
bool AddPulseForce(int Multipler); /*dla drezyny*/
|
||||||
|
|
||||||
bool SandboxManual(bool const State, range_t const Notify = range_t::consist); /*wlacza/wylacza reczne sypanie piasku*/
|
bool SandboxManual(bool State, range_t Notify = range_t::consist); /*wlacza/wylacza reczne sypanie piasku*/
|
||||||
bool SandboxAuto(bool const State, range_t const Notify = range_t::consist); /*wlacza/wylacza automatyczne sypanie piasku*/
|
bool SandboxAuto(bool State, range_t Notify = range_t::consist); /*wlacza/wylacza automatyczne sypanie piasku*/
|
||||||
bool Sandbox(bool const State, range_t const Notify = range_t::consist); /*wlacza/wylacza sypanie piasku*/
|
bool Sandbox(bool State, range_t Notify = range_t::consist); /*wlacza/wylacza sypanie piasku*/
|
||||||
bool SandboxAutoAllow(bool const State); /*wlacza/wylacza zezwolenie na automatyczne sypanie piasku*/
|
bool SandboxAutoAllow(bool State); /*wlacza/wylacza zezwolenie na automatyczne sypanie piasku*/
|
||||||
|
|
||||||
/*! zbijanie czuwaka/SHP*/
|
/*! zbijanie czuwaka/SHP*/
|
||||||
void SecuritySystemReset(void);
|
void SecuritySystemReset(void);
|
||||||
void SecuritySystemCheck(double dt);
|
void SecuritySystemCheck(double dt);
|
||||||
|
|
||||||
bool BatterySwitch(bool State, range_t const Notify = range_t::consist);
|
bool BatterySwitch(bool State, range_t Notify = range_t::consist);
|
||||||
bool EpFuseSwitch(bool State);
|
bool EpFuseSwitch(bool State);
|
||||||
bool SpringBrakeActivate(bool State);
|
bool SpringBrakeActivate(bool State);
|
||||||
bool SpringBrakeShutOff(bool State);
|
bool SpringBrakeShutOff(bool State);
|
||||||
@@ -2378,20 +2378,20 @@ class TMoverParameters
|
|||||||
/*! stopnie hamowania - hamulec zasadniczy*/
|
/*! stopnie hamowania - hamulec zasadniczy*/
|
||||||
bool IncBrakeLevelOld(void);
|
bool IncBrakeLevelOld(void);
|
||||||
bool DecBrakeLevelOld(void);
|
bool DecBrakeLevelOld(void);
|
||||||
bool IncLocalBrakeLevel(float const CtrlSpeed);
|
bool IncLocalBrakeLevel(float CtrlSpeed);
|
||||||
bool DecLocalBrakeLevel(float const CtrlSpeed);
|
bool DecLocalBrakeLevel(float CtrlSpeed);
|
||||||
/*! ABu 010205: - skrajne polozenia ham. pomocniczego*/
|
/*! ABu 010205: - skrajne polozenia ham. pomocniczego*/
|
||||||
bool IncManualBrakeLevel(int CtrlSpeed);
|
bool IncManualBrakeLevel(int CtrlSpeed);
|
||||||
bool DecManualBrakeLevel(int CtrlSpeed);
|
bool DecManualBrakeLevel(int CtrlSpeed);
|
||||||
/*! oddzielny nastawnik hamulca elektrodynamicznego (gdy SplitEDPneumaticBrake)*/
|
/*! oddzielny nastawnik hamulca elektrodynamicznego (gdy SplitEDPneumaticBrake)*/
|
||||||
bool IncDynamicBrakeLevel(float const CtrlSpeed);
|
bool IncDynamicBrakeLevel(float CtrlSpeed);
|
||||||
bool DecDynamicBrakeLevel(float const CtrlSpeed);
|
bool DecDynamicBrakeLevel(float CtrlSpeed);
|
||||||
bool DynamicBrakeLevelSet(double Position);
|
bool DynamicBrakeLevelSet(double Position);
|
||||||
double DynamicBrakeRatio(void) const;
|
double DynamicBrakeRatio(void) const;
|
||||||
bool DynamicBrakeAvailable(void) const; /*czy ED dostepny w aktualnym oknie predkosci Vh0..Vh1*/
|
bool DynamicBrakeAvailable(void) const; /*czy ED dostepny w aktualnym oknie predkosci Vh0..Vh1*/
|
||||||
bool DynamicBrakeSwitch(bool Switch);
|
bool DynamicBrakeSwitch(bool Switch);
|
||||||
bool RadiostopSwitch(bool Switch);
|
bool RadiostopSwitch(bool Switch);
|
||||||
bool AlarmChainSwitch(bool const State);
|
bool AlarmChainSwitch(bool State);
|
||||||
bool AntiSlippingBrake(void);
|
bool AntiSlippingBrake(void);
|
||||||
bool BrakeReleaser(int state);
|
bool BrakeReleaser(int state);
|
||||||
bool UniversalBrakeButton(int button, int state); /*uniwersalny przycisk hamulca*/
|
bool UniversalBrakeButton(int button, int state); /*uniwersalny przycisk hamulca*/
|
||||||
@@ -2423,54 +2423,54 @@ class TMoverParameters
|
|||||||
double BrakeForceR(double ratio, double velocity);
|
double BrakeForceR(double ratio, double velocity);
|
||||||
double BrakeForceP(double press, double velocity);
|
double BrakeForceP(double press, double velocity);
|
||||||
double BrakeForce(const TTrackParam &Track);
|
double BrakeForce(const TTrackParam &Track);
|
||||||
double CouplerForce(int const End, double dt);
|
double CouplerForce(int End, double dt);
|
||||||
void CollisionDetect(int const End, double const dt);
|
void CollisionDetect(int End, double dt);
|
||||||
/*obrot kol uwzgledniajacy poslizg*/
|
/*obrot kol uwzgledniajacy poslizg*/
|
||||||
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
||||||
|
|
||||||
/*--funkcje dla lokomotyw*/
|
/*--funkcje dla lokomotyw*/
|
||||||
bool WaterPumpBreakerSwitch(bool State, range_t const Notify = range_t::consist); // water pump breaker state toggle
|
bool WaterPumpBreakerSwitch(bool State, range_t Notify = range_t::consist); // water pump breaker state toggle
|
||||||
bool WaterPumpSwitch(bool State, range_t const Notify = range_t::consist); // water pump state toggle
|
bool WaterPumpSwitch(bool State, range_t Notify = range_t::consist); // water pump state toggle
|
||||||
bool WaterPumpSwitchOff(bool State, range_t const Notify = range_t::consist); // water pump state toggle
|
bool WaterPumpSwitchOff(bool State, range_t Notify = range_t::consist); // water pump state toggle
|
||||||
bool WaterHeaterBreakerSwitch(bool State, range_t const Notify = range_t::consist); // water heater breaker state toggle
|
bool WaterHeaterBreakerSwitch(bool State, range_t Notify = range_t::consist); // water heater breaker state toggle
|
||||||
bool WaterHeaterSwitch(bool State, range_t const Notify = range_t::consist); // water heater state toggle
|
bool WaterHeaterSwitch(bool State, range_t Notify = range_t::consist); // water heater state toggle
|
||||||
bool WaterCircuitsLinkSwitch(bool State, range_t const Notify = range_t::consist); // water circuits link state toggle
|
bool WaterCircuitsLinkSwitch(bool State, range_t Notify = range_t::consist); // water circuits link state toggle
|
||||||
bool FuelPumpSwitch(bool State, range_t const Notify = range_t::consist); // fuel pump state toggle
|
bool FuelPumpSwitch(bool State, range_t Notify = range_t::consist); // fuel pump state toggle
|
||||||
bool FuelPumpSwitchOff(bool State, range_t const Notify = range_t::consist); // fuel pump state toggle
|
bool FuelPumpSwitchOff(bool State, range_t Notify = range_t::consist); // fuel pump state toggle
|
||||||
bool OilPumpSwitch(bool State, range_t const Notify = range_t::consist); // oil pump state toggle
|
bool OilPumpSwitch(bool State, range_t Notify = range_t::consist); // oil pump state toggle
|
||||||
bool OilPumpSwitchOff(bool State, range_t const Notify = range_t::consist); // oil pump state toggle
|
bool OilPumpSwitchOff(bool State, range_t Notify = range_t::consist); // oil pump state toggle
|
||||||
bool MotorBlowersSwitch(bool State, end const Side, range_t const Notify = range_t::consist); // traction motor fan state toggle
|
bool MotorBlowersSwitch(bool State, end Side, range_t Notify = range_t::consist); // traction motor fan state toggle
|
||||||
bool MotorBlowersSwitchOff(bool State, end const Side, range_t const Notify = range_t::consist); // traction motor fan state toggle
|
bool MotorBlowersSwitchOff(bool State, end Side, range_t Notify = range_t::consist); // traction motor fan state toggle
|
||||||
bool CompartmentLightsSwitch(bool State, range_t const Notify = range_t::consist); // compartment lights state toggle
|
bool CompartmentLightsSwitch(bool State, range_t Notify = range_t::consist); // compartment lights state toggle
|
||||||
bool CompartmentLightsSwitchOff(bool State, range_t const Notify = range_t::consist); // compartment lights state toggle
|
bool CompartmentLightsSwitchOff(bool State, range_t Notify = range_t::consist); // compartment lights state toggle
|
||||||
bool MainSwitch(bool const State, range_t const Notify = range_t::consist); /*! wylacznik glowny*/
|
bool MainSwitch(bool State, range_t Notify = range_t::consist); /*! wylacznik glowny*/
|
||||||
void MainSwitch_(bool const State);
|
void MainSwitch_(bool State);
|
||||||
bool MainSwitchCheck() const; // checks conditions for closing the line breaker
|
bool MainSwitchCheck() const; // checks conditions for closing the line breaker
|
||||||
bool ConverterSwitch(bool State, range_t const Notify = range_t::consist); /*! wl/wyl przetwornicy*/
|
bool ConverterSwitch(bool State, range_t Notify = range_t::consist); /*! wl/wyl przetwornicy*/
|
||||||
bool CompressorSwitch(bool State, range_t const Notify = range_t::consist); /*! wl/wyl sprezarki*/
|
bool CompressorSwitch(bool State, range_t Notify = range_t::consist); /*! wl/wyl sprezarki*/
|
||||||
bool ChangeCompressorPreset(int const Change, range_t const Notify = range_t::consist);
|
bool ChangeCompressorPreset(int Change, range_t Notify = range_t::consist);
|
||||||
bool HeatingSwitch(bool const State, range_t const Notify = range_t::consist);
|
bool HeatingSwitch(bool State, range_t Notify = range_t::consist);
|
||||||
void HeatingSwitch_(bool const State);
|
void HeatingSwitch_(bool State);
|
||||||
double EnginePowerSourceVoltage() const; // returns voltage of defined main engine power source
|
double EnginePowerSourceVoltage() const; // returns voltage of defined main engine power source
|
||||||
|
|
||||||
/*-funkcje typowe dla lokomotywy elektrycznej*/
|
/*-funkcje typowe dla lokomotywy elektrycznej*/
|
||||||
void LowVoltagePowerCheck(double const Deltatime);
|
void LowVoltagePowerCheck(double Deltatime);
|
||||||
void MainsCheck(double const Deltatime);
|
void MainsCheck(double Deltatime);
|
||||||
void PowerCouplersCheck(double const Deltatime, coupling const Coupling);
|
void PowerCouplersCheck(double Deltatime, coupling Coupling);
|
||||||
void ConverterCheck(double const Timestep); // przetwornica
|
void ConverterCheck(double Timestep); // przetwornica
|
||||||
void HeatingCheck(double const Timestep);
|
void HeatingCheck(double Timestep);
|
||||||
void WaterPumpCheck(double const Timestep);
|
void WaterPumpCheck(double Timestep);
|
||||||
void WaterHeaterCheck(double const Timestep);
|
void WaterHeaterCheck(double Timestep);
|
||||||
void FuelPumpCheck(double const Timestep);
|
void FuelPumpCheck(double Timestep);
|
||||||
void OilPumpCheck(double const Timestep);
|
void OilPumpCheck(double Timestep);
|
||||||
void MotorBlowersCheck(double const Timestep);
|
void MotorBlowersCheck(double Timestep);
|
||||||
void PantographsCheck(double const Timestep);
|
void PantographsCheck(double Timestep);
|
||||||
void LightsCheck(double const Timestep);
|
void LightsCheck(double Timestep);
|
||||||
bool FuseOn(range_t const Notify = range_t::consist); // bezpiecznik nadamiary
|
bool FuseOn(range_t Notify = range_t::consist); // bezpiecznik nadamiary
|
||||||
bool FuseFlagCheck(void) const; // sprawdzanie flagi nadmiarowego
|
bool FuseFlagCheck(void) const; // sprawdzanie flagi nadmiarowego
|
||||||
void FuseOff(void); // wylaczenie nadmiarowego
|
void FuseOff(void); // wylaczenie nadmiarowego
|
||||||
bool UniversalResetButton(int const Button, range_t const Notify = range_t::consist);
|
bool UniversalResetButton(int Button, range_t Notify = range_t::consist);
|
||||||
bool RelayReset(int const Relays, range_t const Notify = range_t::consist); // resets specified relays
|
bool RelayReset(int Relays, range_t Notify = range_t::consist); // resets specified relays
|
||||||
double ShowCurrent(int AmpN) const; // pokazuje bezwgl. wartosc pradu na wybranym amperomierzu
|
double ShowCurrent(int AmpN) const; // pokazuje bezwgl. wartosc pradu na wybranym amperomierzu
|
||||||
double ShowCurrentP(int AmpN) const; // pokazuje bezwgl. wartosc pradu w wybranym pojezdzie //Q 20160722
|
double ShowCurrentP(int AmpN) const; // pokazuje bezwgl. wartosc pradu w wybranym pojezdzie //Q 20160722
|
||||||
|
|
||||||
@@ -2484,16 +2484,16 @@ class TMoverParameters
|
|||||||
|
|
||||||
bool CutOffEngine(void); // odlaczenie udszkodzonych silnikow
|
bool CutOffEngine(void); // odlaczenie udszkodzonych silnikow
|
||||||
/*funkcje automatycznego rozruchu np EN57*/
|
/*funkcje automatycznego rozruchu np EN57*/
|
||||||
bool MaxCurrentSwitch(bool State, range_t const Notify = range_t::consist); // przelacznik pradu wysokiego rozruchu
|
bool MaxCurrentSwitch(bool State, range_t Notify = range_t::consist); // przelacznik pradu wysokiego rozruchu
|
||||||
bool MinCurrentSwitch(bool State); // przelacznik pradu automatycznego rozruchu
|
bool MinCurrentSwitch(bool State); // przelacznik pradu automatycznego rozruchu
|
||||||
bool AutoRelaySwitch(bool State); // przelacznik automatycznego rozruchu
|
bool AutoRelaySwitch(bool State); // przelacznik automatycznego rozruchu
|
||||||
bool AutoRelayCheck(); // symulacja automatycznego rozruchu
|
bool AutoRelayCheck(); // symulacja automatycznego rozruchu
|
||||||
bool MotorConnectorsCheck();
|
bool MotorConnectorsCheck();
|
||||||
bool ResistorsFlagCheck(void) const; // sprawdzenie kontrolki oporow rozruchowych NBMX
|
bool ResistorsFlagCheck(void) const; // sprawdzenie kontrolki oporow rozruchowych NBMX
|
||||||
|
|
||||||
bool OperatePantographsValve(operation_t const State, range_t const Notify = range_t::consist);
|
bool OperatePantographsValve(operation_t State, range_t Notify = range_t::consist);
|
||||||
bool OperatePantographValve(end const End, operation_t const State, range_t const Notify = range_t::consist);
|
bool OperatePantographValve(end End, operation_t State, range_t Notify = range_t::consist);
|
||||||
bool DropAllPantographs(bool const State, range_t const Notify = range_t::consist);
|
bool DropAllPantographs(bool State, range_t Notify = range_t::consist);
|
||||||
|
|
||||||
void CheckEIMIC(double dt); // sprawdzenie i zmiana nastawy zintegrowanego nastawnika jazdy/hamowania
|
void CheckEIMIC(double dt); // sprawdzenie i zmiana nastawy zintegrowanego nastawnika jazdy/hamowania
|
||||||
void CheckSpeedCtrl(double dt);
|
void CheckSpeedCtrl(double dt);
|
||||||
@@ -2510,23 +2510,23 @@ class TMoverParameters
|
|||||||
double dizel_fillcheck(int mcp, double dt);
|
double dizel_fillcheck(int mcp, double dt);
|
||||||
double dizel_Momentum(double dizel_fill, double n, double dt);
|
double dizel_Momentum(double dizel_fill, double n, double dt);
|
||||||
double dizel_MomentumRetarder(double n, double dt); // moment hamowania retardera
|
double dizel_MomentumRetarder(double n, double dt); // moment hamowania retardera
|
||||||
void dizel_HeatSet(float const Value);
|
void dizel_HeatSet(float Value);
|
||||||
void dizel_Heat(double const dt);
|
void dizel_Heat(double dt);
|
||||||
bool dizel_StartupCheck();
|
bool dizel_StartupCheck();
|
||||||
bool dizel_Update(double dt);
|
bool dizel_Update(double dt);
|
||||||
|
|
||||||
/* funckje dla wagonow*/
|
/* funckje dla wagonow*/
|
||||||
bool AssignLoad(std::string const &Name, float const Amount = 0.f);
|
bool AssignLoad(std::string const &Name, float Amount = 0.f);
|
||||||
bool LoadingDone(double LSpeed, std::string const &Loadname);
|
bool LoadingDone(double LSpeed, std::string const &Loadname);
|
||||||
bool PermitDoors(side const Door, bool const State = true, range_t const Notify = range_t::consist);
|
bool PermitDoors(side Door, bool State = true, range_t Notify = range_t::consist);
|
||||||
void PermitDoors_(side const Door, bool const State = true);
|
void PermitDoors_(side Door, bool State = true);
|
||||||
bool ChangeDoorPermitPreset(int const Change, range_t const Notify = range_t::consist);
|
bool ChangeDoorPermitPreset(int Change, range_t Notify = range_t::consist);
|
||||||
bool PermitDoorStep(bool const State, range_t const Notify = range_t::consist);
|
bool PermitDoorStep(bool State, range_t Notify = range_t::consist);
|
||||||
bool ChangeDoorControlMode(bool const State, range_t const Notify = range_t::consist);
|
bool ChangeDoorControlMode(bool State, range_t Notify = range_t::consist);
|
||||||
bool OperateDoors(side const Door, bool const State, range_t const Notify = range_t::consist);
|
bool OperateDoors(side Door, bool State, range_t Notify = range_t::consist);
|
||||||
bool LockDoors(bool const State, range_t const Notify = range_t::consist);
|
bool LockDoors(bool State, range_t Notify = range_t::consist);
|
||||||
bool signal_departure(bool const State, range_t const Notify = range_t::consist); // toggles departure warning
|
bool signal_departure(bool State, range_t Notify = range_t::consist); // toggles departure warning
|
||||||
void update_doors(double const Deltatime); // door controller update
|
void update_doors(double Deltatime); // door controller update
|
||||||
|
|
||||||
/* funkcje dla samochodow*/
|
/* funkcje dla samochodow*/
|
||||||
bool ChangeOffsetH(double DeltaOffset);
|
bool ChangeOffsetH(double DeltaOffset);
|
||||||
@@ -2543,7 +2543,7 @@ class TMoverParameters
|
|||||||
void LoadFIZ_Wheels(std::string const &line);
|
void LoadFIZ_Wheels(std::string const &line);
|
||||||
void LoadFIZ_Brake(std::string const &line);
|
void LoadFIZ_Brake(std::string const &line);
|
||||||
void LoadFIZ_Doors(std::string const &line);
|
void LoadFIZ_Doors(std::string const &line);
|
||||||
void LoadFIZ_BuffCoupl(std::string const &line, int const Index);
|
void LoadFIZ_BuffCoupl(std::string const &line, int Index);
|
||||||
void LoadFIZ_TurboPos(std::string const &line);
|
void LoadFIZ_TurboPos(std::string const &line);
|
||||||
void LoadFIZ_Cntrl(std::string const &line);
|
void LoadFIZ_Cntrl(std::string const &line);
|
||||||
void LoadFIZ_Blending(std::string const &line);
|
void LoadFIZ_Blending(std::string const &line);
|
||||||
@@ -2568,7 +2568,7 @@ class TMoverParameters
|
|||||||
void LoadFIZ_LightsList(std::string const &Input);
|
void LoadFIZ_LightsList(std::string const &Input);
|
||||||
void LoadFIZ_DimmerList(std::string const &Input);
|
void LoadFIZ_DimmerList(std::string const &Input);
|
||||||
void LoadFIZ_CompressorList(std::string const &Input);
|
void LoadFIZ_CompressorList(std::string const &Input);
|
||||||
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string const Prefix, std::string const &Input);
|
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string Prefix, std::string const &Input);
|
||||||
TPowerType LoadFIZ_PowerDecode(std::string const &Power);
|
TPowerType LoadFIZ_PowerDecode(std::string const &Power);
|
||||||
TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
|
TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
|
||||||
TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
|
TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class TPrzeciwposlizg : public TRura // przy napelnianiu - rura, przy poslizgu -
|
|||||||
public:
|
public:
|
||||||
void SetPoslizg(bool flag);
|
void SetPoslizg(bool flag);
|
||||||
void Update(double dt) /*override*/;
|
void Update(double dt) /*override*/;
|
||||||
inline TPrzeciwposlizg() : TRura()
|
TPrzeciwposlizg() : TRura()
|
||||||
{
|
{
|
||||||
Poslizg = false;
|
Poslizg = false;
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ class TRapid : public TPrzekladnik {
|
|||||||
void SetRapidParams(double mult, double size);
|
void SetRapidParams(double mult, double size);
|
||||||
void SetRapidStatus(bool rs);
|
void SetRapidStatus(bool rs);
|
||||||
void Update(double dt) /*override*/;
|
void Update(double dt) /*override*/;
|
||||||
inline TRapid() :
|
TRapid() :
|
||||||
TPrzekladnik()
|
TPrzekladnik()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
@@ -137,7 +137,7 @@ class TPrzekCiagly : public TPrzekladnik {
|
|||||||
public:
|
public:
|
||||||
void SetMult(double m);
|
void SetMult(double m);
|
||||||
void Update(double dt) /*override*/;
|
void Update(double dt) /*override*/;
|
||||||
inline TPrzekCiagly() :
|
TPrzekCiagly() :
|
||||||
TPrzekladnik()
|
TPrzekladnik()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
@@ -151,7 +151,7 @@ class TPrzek_PZZ : public TPrzekladnik {
|
|||||||
public:
|
public:
|
||||||
void SetLBP(double P);
|
void SetLBP(double P);
|
||||||
void Update(double dt) /*override*/;
|
void Update(double dt) /*override*/;
|
||||||
inline TPrzek_PZZ() :
|
TPrzek_PZZ() :
|
||||||
TPrzekladnik()
|
TPrzekladnik()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
@@ -175,7 +175,7 @@ class TPrzekED : public TRura {
|
|||||||
public:
|
public:
|
||||||
void SetP(double P);
|
void SetP(double P);
|
||||||
void Update(double dt) /*override*/;
|
void Update(double dt) /*override*/;
|
||||||
inline TPrzekED() :
|
TPrzekED() :
|
||||||
TRura()
|
TRura()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
@@ -205,25 +205,25 @@ class TNESt3 : public TBrake {
|
|||||||
double LBP = 0.0; // cisnienie hamulca pomocniczego
|
double LBP = 0.0; // cisnienie hamulca pomocniczego
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline TNESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) :
|
TNESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) :
|
||||||
TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{}
|
{}
|
||||||
void Init( double const PP, double const HPP, double const LPP, double const BP, int const BDF ) /*override*/;
|
void Init( double PP, double HPP, double LPP, double BP, int BDF ) /*override*/;
|
||||||
virtual double GetPF( double const PP, double const dt, double const Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
|
virtual double GetPF( double PP, double dt, double Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
||||||
virtual double GetCRP() /*override*/;
|
virtual double GetCRP() /*override*/;
|
||||||
void CheckState(double const BCP, double &dV1); // glowny przyrzad rozrzadczy
|
void CheckState(double BCP, double &dV1); // glowny przyrzad rozrzadczy
|
||||||
void CheckReleaser(double const dt); // odluzniacz
|
void CheckReleaser(double dt); // odluzniacz
|
||||||
double CVs(double const BP); // napelniacz sterujacego
|
double CVs(double BP); // napelniacz sterujacego
|
||||||
double BVs(double const BCP); // napelniacz pomocniczego
|
double BVs(double BCP); // napelniacz pomocniczego
|
||||||
void SetSize( int const size, std::string const ¶ms ); // ustawianie dysz (rozmiaru ZR), przekladniki
|
void SetSize( int size, std::string const ¶ms ); // ustawianie dysz (rozmiaru ZR), przekladniki
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
virtual void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
virtual void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
||||||
void SetLBP(double const P); // cisnienie z hamulca pomocniczego
|
void SetLBP(double P); // cisnienie z hamulca pomocniczego
|
||||||
};
|
};
|
||||||
|
|
||||||
extern double d2A( double const d );
|
extern double d2A( double d );
|
||||||
|
|
||||||
#endif // INCLUDED_OERLIKON_EST_H
|
#endif // INCLUDED_OERLIKON_EST_H
|
||||||
// END
|
// END
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ class TBrake
|
|||||||
/// <param name="LPP">Low pressure threshold [bar].</param>
|
/// <param name="LPP">Low pressure threshold [bar].</param>
|
||||||
/// <param name="BP">Initial brake cylinder pressure [bar].</param>
|
/// <param name="BP">Initial brake cylinder pressure [bar].</param>
|
||||||
/// <param name="BDF">Initial brake delay flag.</param>
|
/// <param name="BDF">Initial brake delay flag.</param>
|
||||||
virtual void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF); // inicjalizacja hamulca
|
virtual void Init(double PP, double HPP, double LPP, double BP, int BDF); // inicjalizacja hamulca
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current friction coefficient between blocks and the wheel/disc.
|
/// Returns the current friction coefficient between blocks and the wheel/disc.
|
||||||
@@ -385,7 +385,7 @@ class TBrake
|
|||||||
/// <param name="Vel">Current vehicle velocity [m/s or km/h depending on FM].</param>
|
/// <param name="Vel">Current vehicle velocity [m/s or km/h depending on FM].</param>
|
||||||
/// <param name="N">Normal force on the block [N].</param>
|
/// <param name="N">Normal force on the block [N].</param>
|
||||||
/// <returns>Friction coefficient.</returns>
|
/// <returns>Friction coefficient.</returns>
|
||||||
double GetFC(double const Vel, double const N); // wspolczynnik tarcia - hamulec wie lepiej
|
double GetFC(double Vel, double N); // wspolczynnik tarcia - hamulec wie lepiej
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Advances the brake distributor for one simulation step and returns the net
|
/// Advances the brake distributor for one simulation step and returns the net
|
||||||
/// volume exchanged with the brake pipe (positive = drawn from the brake pipe).
|
/// volume exchanged with the brake pipe (positive = drawn from the brake pipe).
|
||||||
@@ -394,7 +394,7 @@ class TBrake
|
|||||||
/// <param name="dt">Time step [s].</param>
|
/// <param name="dt">Time step [s].</param>
|
||||||
/// <param name="Vel">Vehicle velocity [m/s].</param>
|
/// <param name="Vel">Vehicle velocity [m/s].</param>
|
||||||
/// <returns>Volume exchanged between the valve pre-chamber and the brake pipe.</returns>
|
/// <returns>Volume exchanged between the valve pre-chamber and the brake pipe.</returns>
|
||||||
virtual double GetPF(double const PP, double const dt, double const Vel); // przeplyw miedzy komora wstepna i PG
|
virtual double GetPF(double PP, double dt, double Vel); // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the piston force produced by the brake cylinder pressure.
|
/// Returns the piston force produced by the brake cylinder pressure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -406,7 +406,7 @@ class TBrake
|
|||||||
/// <param name="HP">High-pressure source pressure [bar].</param>
|
/// <param name="HP">High-pressure source pressure [bar].</param>
|
||||||
/// <param name="dt">Time step [s].</param>
|
/// <param name="dt">Time step [s].</param>
|
||||||
/// <returns>Net flow from the high-pressure line.</returns>
|
/// <returns>Net flow from the high-pressure line.</returns>
|
||||||
virtual double GetHPFlow(double const HP, double const dt); // przeplyw - 8 bar
|
virtual double GetHPFlow(double HP, double dt); // przeplyw - 8 bar
|
||||||
/// <summary>Returns brake cylinder gauge pressure [bar].</summary>
|
/// <summary>Returns brake cylinder gauge pressure [bar].</summary>
|
||||||
double GetBCP(); // cisnienie cylindrow hamulcowych
|
double GetBCP(); // cisnienie cylindrow hamulcowych
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -425,12 +425,12 @@ class TBrake
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="nBDF">Requested delay flag (bdelay_*).</param>
|
/// <param name="nBDF">Requested delay flag (bdelay_*).</param>
|
||||||
/// <returns>True if accepted (mode supported and changed); false otherwise.</returns>
|
/// <returns>True if accepted (mode supported and changed); false otherwise.</returns>
|
||||||
bool SetBDF(int const nBDF); // nastawiacz GPRM
|
bool SetBDF(int nBDF); // nastawiacz GPRM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Engages or disengages the releaser (odluzniacz), updating the brake state flags.
|
/// Engages or disengages the releaser (odluzniacz), updating the brake state flags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="state">1 to engage releaser, 0 to disengage.</param>
|
/// <param name="state">1 to engage releaser, 0 to disengage.</param>
|
||||||
void Releaser(int const state); // odluzniacz
|
void Releaser(int state); // odluzniacz
|
||||||
/// <summary>Returns true if the releaser is currently engaged.</summary>
|
/// <summary>Returns true if the releaser is currently engaged.</summary>
|
||||||
bool Releaser() const;
|
bool Releaser() const;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -438,7 +438,7 @@ class TBrake
|
|||||||
/// Default no-op; overridden by EP-capable distributors.
|
/// Default no-op; overridden by EP-capable distributors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="nEPS">EP intensity (typically -1..1).</param>
|
/// <param name="nEPS">EP intensity (typically -1..1).</param>
|
||||||
virtual void SetEPS(double const nEPS); // hamulec EP
|
virtual void SetEPS(double nEPS); // hamulec EP
|
||||||
/// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary>
|
/// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary>
|
||||||
/// <param name="RMR">Rapid ratio.</param>
|
/// <param name="RMR">Rapid ratio.</param>
|
||||||
virtual void SetRM(double const RMR) {}; // ustalenie przelozenia rapida
|
virtual void SetRM(double const RMR) {}; // ustalenie przelozenia rapida
|
||||||
@@ -471,14 +471,14 @@ class TBrake
|
|||||||
int GetStatus(); // flaga statusu, moze sie przydac do odglosow
|
int GetStatus(); // flaga statusu, moze sie przydac do odglosow
|
||||||
/// <summary>Sets the anti-slip target pressure.</summary>
|
/// <summary>Sets the anti-slip target pressure.</summary>
|
||||||
/// <param name="Press">Pressure [bar].</param>
|
/// <param name="Press">Pressure [bar].</param>
|
||||||
void SetASBP(double const Press); // ustalenie cisnienia pp
|
void SetASBP(double Press); // ustalenie cisnienia pp
|
||||||
/// <summary>Vents all reservoirs to zero pressure (used when the vehicle is decoupled or reset).</summary>
|
/// <summary>Vents all reservoirs to zero pressure (used when the vehicle is decoupled or reset).</summary>
|
||||||
virtual void ForceEmptiness();
|
virtual void ForceEmptiness();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a specified relative amount of air from the reservoirs to simulate leaks.
|
/// Removes a specified relative amount of air from the reservoirs to simulate leaks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Amount">Fraction of pressure to bleed (0..1) per call.</param>
|
/// <param name="Amount">Fraction of pressure to bleed (0..1) per call.</param>
|
||||||
virtual void ForceLeak(double const Amount);
|
virtual void ForceLeak(double Amount);
|
||||||
/// <summary>Returns and clears the accumulated SoundFlag bitfield.</summary>
|
/// <summary>Returns and clears the accumulated SoundFlag bitfield.</summary>
|
||||||
int GetSoundFlag();
|
int GetSoundFlag();
|
||||||
/// <summary>Returns the current brake status flags.</summary>
|
/// <summary>Returns the current brake status flags.</summary>
|
||||||
@@ -537,26 +537,26 @@ class TWest : public TBrake
|
|||||||
/// <param name="LPP">Low pressure.</param>
|
/// <param name="LPP">Low pressure.</param>
|
||||||
/// <param name="BP">Initial cylinder pressure.</param>
|
/// <param name="BP">Initial cylinder pressure.</param>
|
||||||
/// <param name="BDF">Initial brake delay flag.</param>
|
/// <param name="BDF">Initial brake delay flag.</param>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>Sets the auxiliary brake target pressure and engages the DCV when above cylinder.</summary>
|
/// <summary>Sets the auxiliary brake target pressure and engages the DCV when above cylinder.</summary>
|
||||||
/// <param name="P">Pressure [bar].</param>
|
/// <param name="P">Pressure [bar].</param>
|
||||||
void SetLBP(double const P); // cisnienie z hamulca pomocniczego
|
void SetLBP(double P); // cisnienie z hamulca pomocniczego
|
||||||
/// <summary>One-step distributor advance (Westinghouse logic).</summary>
|
/// <summary>One-step distributor advance (Westinghouse logic).</summary>
|
||||||
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Returns the high-pressure flow drawn during the last GetPF step.</summary>
|
/// <summary>Returns the high-pressure flow drawn during the last GetPF step.</summary>
|
||||||
double GetHPFlow(double const HP, double const dt) /*override*/;
|
double GetHPFlow(double HP, double dt) /*override*/;
|
||||||
/// <summary>Recomputes the load-weighing pressure coefficient for the current mass.</summary>
|
/// <summary>Recomputes the load-weighing pressure coefficient for the current mass.</summary>
|
||||||
/// <param name="mass">Vehicle mass.</param>
|
/// <param name="mass">Vehicle mass.</param>
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
/// <summary>Sets the EP brake state and toggles the DCV / latches LBP from cylinder pressure on release.</summary>
|
/// <summary>Sets the EP brake state and toggles the DCV / latches LBP from cylinder pressure on release.</summary>
|
||||||
/// <param name="nEPS">New EP intensity.</param>
|
/// <param name="nEPS">New EP intensity.</param>
|
||||||
void SetEPS(double const nEPS) /*override*/; // stan hamulca EP
|
void SetEPS(double nEPS) /*override*/; // stan hamulca EP
|
||||||
/// <summary>Stores the load-weighing parameters (TareM, LoadM, TareBP).</summary>
|
/// <summary>Stores the load-weighing parameters (TareM, LoadM, TareBP).</summary>
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
|
|
||||||
/// <summary>Constructs the distributor by forwarding all parameters to TBrake.</summary>
|
/// <summary>Constructs the distributor by forwarding all parameters to TBrake.</summary>
|
||||||
inline TWest(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
TWest(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -576,10 +576,10 @@ class TESt : public TBrake
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the ESt distributor; sizes the control reservoir (15 l) and computes BVM.</summary>
|
/// <summary>Initialises the ESt distributor; sizes the control reservoir (15 l) and computes BVM.</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for the ESt baseline.</summary>
|
/// <summary>One-step distributor advance for the ESt baseline.</summary>
|
||||||
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Sets ESt-specific characteristic parameters (placeholder; used by some variants).</summary>
|
/// <summary>Sets ESt-specific characteristic parameters (placeholder; used by some variants).</summary>
|
||||||
/// <param name="i_crc">Characteristic value.</param>
|
/// <param name="i_crc">Characteristic value.</param>
|
||||||
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
|
||||||
@@ -614,7 +614,7 @@ class TESt : public TBrake
|
|||||||
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
||||||
|
|
||||||
/// <summary>Constructs the ESt distributor and creates the control reservoir.</summary>
|
/// <summary>Constructs the ESt distributor and creates the control reservoir.</summary>
|
||||||
inline TESt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TESt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
CntrlRes = std::make_shared<TReservoir>();
|
CntrlRes = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -633,10 +633,10 @@ class TESt3 : public TESt
|
|||||||
public:
|
public:
|
||||||
/// <summary>One-step distributor advance for ESt3 (G/P-dependent fill/release curves).</summary>
|
/// <summary>One-step distributor advance for ESt3 (G/P-dependent fill/release curves).</summary>
|
||||||
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
/// <returns>Net flow exchanged with the brake pipe.</returns>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
|
|
||||||
/// <summary>Constructs the ESt3 distributor.</summary>
|
/// <summary>Constructs the ESt3 distributor.</summary>
|
||||||
inline TESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
TESt3(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -660,16 +660,16 @@ class TESt3AL2 : public TESt3
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the impulse chamber on top of the ESt initialisation.</summary>
|
/// <summary>Initialises the impulse chamber on top of the ESt initialisation.</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for ESt3/AL2 with load-weighing relay.</summary>
|
/// <summary>One-step distributor advance for ESt3/AL2 with load-weighing relay.</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
/// <summary>Stores the load-weighing parameters.</summary>
|
/// <summary>Stores the load-weighing parameters.</summary>
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
|
|
||||||
/// <summary>Constructs the distributor and creates the impulse chamber.</summary>
|
/// <summary>Constructs the distributor and creates the impulse chamber.</summary>
|
||||||
inline TESt3AL2(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt3(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TESt3AL2(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt3(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
ImplsRes = std::make_shared<TReservoir>();
|
ImplsRes = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -695,12 +695,12 @@ class TESt4R : public TESt
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the ESt4R; sizes the impulse chamber and selects the R delay.</summary>
|
/// <summary>Initialises the ESt4R; sizes the impulse chamber and selects the R delay.</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for ESt4R (rapid step active above velocity threshold).</summary>
|
/// <summary>One-step distributor advance for ESt4R (rapid step active above velocity threshold).</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
|
|
||||||
/// <summary>Constructs the distributor and creates the impulse chamber.</summary>
|
/// <summary>Constructs the distributor and creates the impulse chamber.</summary>
|
||||||
inline TESt4R(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TESt4R(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
ImplsRes = std::make_shared<TReservoir>();
|
ImplsRes = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -726,24 +726,24 @@ class TLSt : public TESt4R
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the LSt; resizes the valve and impulse reservoirs and presets pressures.</summary>
|
/// <summary>Initialises the LSt; resizes the valve and impulse reservoirs and presets pressures.</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
||||||
void SetLBP(double const P); // cisnienie z hamulca pomocniczego
|
void SetLBP(double P); // cisnienie z hamulca pomocniczego
|
||||||
/// <summary>Sets the rapid step ratio (RM = 1 - RMR).</summary>
|
/// <summary>Sets the rapid step ratio (RM = 1 - RMR).</summary>
|
||||||
/// <param name="RMR">Reduction ratio (0 disables rapid, > 0 enables).</param>
|
/// <param name="RMR">Reduction ratio (0 disables rapid, > 0 enables).</param>
|
||||||
void SetRM(double const RMR); // ustalenie przelozenia rapida
|
void SetRM(double RMR); // ustalenie przelozenia rapida
|
||||||
/// <summary>One-step distributor advance for LSt (DCV + rapid + ED release).</summary>
|
/// <summary>One-step distributor advance for LSt (DCV + rapid + ED release).</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Computes the high-pressure inflow (replenishes the auxiliary reservoir from the main line).</summary>
|
/// <summary>Computes the high-pressure inflow (replenishes the auxiliary reservoir from the main line).</summary>
|
||||||
double GetHPFlow(double const HP, double const dt) /*override*/; // przeplyw - 8 bar
|
double GetHPFlow(double HP, double dt) /*override*/; // przeplyw - 8 bar
|
||||||
/// <summary>Returns the brake-cylinder reference pressure used by the ED brake controller (CVP-BCP * BVM).</summary>
|
/// <summary>Returns the brake-cylinder reference pressure used by the ED brake controller (CVP-BCP * BVM).</summary>
|
||||||
virtual double GetEDBCP(); // cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED w EP09
|
virtual double GetEDBCP(); // cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED w EP09
|
||||||
/// <summary>Sets the ED brake state used to relax the pneumatic brake.</summary>
|
/// <summary>Sets the ED brake state used to relax the pneumatic brake.</summary>
|
||||||
/// <param name="EDstate">ED intensity (0..1).</param>
|
/// <param name="EDstate">ED intensity (0..1).</param>
|
||||||
virtual void SetED(double const EDstate); // stan hamulca ED do luzowania
|
virtual void SetED(double EDstate); // stan hamulca ED do luzowania
|
||||||
|
|
||||||
/// <summary>Constructs the LSt distributor.</summary>
|
/// <summary>Constructs the LSt distributor.</summary>
|
||||||
inline TLSt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt4R(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
TLSt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TESt4R(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -774,18 +774,18 @@ class TEStED : public TLSt
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the EStED — sets up Miedzypoj, ImplsRes and the nozzle characteristics.</summary>
|
/// <summary>Initialises the EStED — sets up Miedzypoj, ImplsRes and the nozzle characteristics.</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for EStED (full EP09 logic with intermediate reservoir).</summary>
|
/// <summary>One-step distributor advance for EStED (full EP09 logic with intermediate reservoir).</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Returns ED-brake reference pressure (ImplsRes pressure scaled by load coefficient).</summary>
|
/// <summary>Returns ED-brake reference pressure (ImplsRes pressure scaled by load coefficient).</summary>
|
||||||
double GetEDBCP() /*override*/; // cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED
|
double GetEDBCP() /*override*/; // cisnienie tylko z hamulca zasadniczego, uzywane do hamulca ED
|
||||||
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
/// <summary>Stores the load-weighing parameters.</summary>
|
/// <summary>Stores the load-weighing parameters.</summary>
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
|
|
||||||
/// <summary>Constructs the distributor and creates the intermediate reservoir.</summary>
|
/// <summary>Constructs the distributor and creates the intermediate reservoir.</summary>
|
||||||
inline TEStED(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TLSt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TEStED(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TLSt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
Miedzypoj = std::make_shared<TReservoir>();
|
Miedzypoj = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -812,21 +812,21 @@ class TEStEP2 : public TLSt
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the EP2-equipped distributor (impulse chamber, P delay).</summary>
|
/// <summary>Initialises the EP2-equipped distributor (impulse chamber, P delay).</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/; // inicjalizacja
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/; // inicjalizacja
|
||||||
/// <summary>One-step distributor advance with EP2 EP brake logic.</summary>
|
/// <summary>One-step distributor advance with EP2 EP brake logic.</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
/// <summary>Sets EP intensity; if EP is active and LBP < cylinder pressure, latches LBP from cylinder.</summary>
|
/// <summary>Sets EP intensity; if EP is active and LBP < cylinder pressure, latches LBP from cylinder.</summary>
|
||||||
void SetEPS(double const nEPS) /*override*/; // stan hamulca EP
|
void SetEPS(double nEPS) /*override*/; // stan hamulca EP
|
||||||
/// <summary>Stores the load-weighing parameters.</summary>
|
/// <summary>Stores the load-weighing parameters.</summary>
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
/// <summary>EP brake flow integration step. Override in EP1 for proportional control.</summary>
|
/// <summary>EP brake flow integration step. Override in EP1 for proportional control.</summary>
|
||||||
/// <param name="dt">Time step [s].</param>
|
/// <param name="dt">Time step [s].</param>
|
||||||
void virtual EPCalc(double dt);
|
void virtual EPCalc(double dt);
|
||||||
|
|
||||||
/// <summary>Constructs the EP2 distributor.</summary>
|
/// <summary>Constructs the EP2 distributor.</summary>
|
||||||
inline TEStEP2(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TLSt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
TEStEP2(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TLSt(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -842,10 +842,10 @@ class TEStEP1 : public TEStEP2
|
|||||||
void EPCalc(double dt);
|
void EPCalc(double dt);
|
||||||
/// <summary>Stores the EP intensity.</summary>
|
/// <summary>Stores the EP intensity.</summary>
|
||||||
/// <param name="nEPS">Target EP value (integer part = direction, fractional part = magnitude).</param>
|
/// <param name="nEPS">Target EP value (integer part = direction, fractional part = magnitude).</param>
|
||||||
void SetEPS(double const nEPS) override; // stan hamulca EP
|
void SetEPS(double nEPS) override; // stan hamulca EP
|
||||||
|
|
||||||
/// <summary>Constructs the EP1 distributor.</summary>
|
/// <summary>Constructs the EP1 distributor.</summary>
|
||||||
inline TEStEP1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TEStEP2(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TEStEP1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TEStEP2(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -867,24 +867,24 @@ class TCV1 : public TBrake
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the CV1 distributor (sizes ZS, sets pressures, computes BVM).</summary>
|
/// <summary>Initialises the CV1 distributor (sizes ZS, sets pressures, computes BVM).</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for the CV1 baseline.</summary>
|
/// <summary>One-step distributor advance for the CV1 baseline.</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
||||||
double GetCRP() /*override*/;
|
double GetCRP() /*override*/;
|
||||||
/// <summary>Updates BrakeStatus based on pre-chamber/cylinder/control reservoir relations and the releaser.</summary>
|
/// <summary>Updates BrakeStatus based on pre-chamber/cylinder/control reservoir relations and the releaser.</summary>
|
||||||
/// <param name="BCP">Cylinder (or impulse) pressure.</param>
|
/// <param name="BCP">Cylinder (or impulse) pressure.</param>
|
||||||
/// <param name="dV1">In/out brake pipe flow correction.</param>
|
/// <param name="dV1">In/out brake pipe flow correction.</param>
|
||||||
void CheckState(double const BCP, double &dV1);
|
void CheckState(double BCP, double &dV1);
|
||||||
/// <summary>Returns the ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>Returns the ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double CVs(double const BP);
|
double CVs(double BP);
|
||||||
/// <summary>Returns the ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>Returns the ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double BVs(double const BCP);
|
double BVs(double BCP);
|
||||||
/// <summary>Vents valve, brake and control reservoirs to zero.</summary>
|
/// <summary>Vents valve, brake and control reservoirs to zero.</summary>
|
||||||
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
||||||
|
|
||||||
/// <summary>Constructs the CV1 distributor and creates the control reservoir.</summary>
|
/// <summary>Constructs the CV1 distributor and creates the control reservoir.</summary>
|
||||||
inline TCV1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TCV1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
CntrlRes = std::make_shared<TReservoir>();
|
CntrlRes = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -922,16 +922,16 @@ class TCV1L_TR : public TCV1
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the CV1-L-TR (sizes the impulse chamber on top of CV1::Init).</summary>
|
/// <summary>Initialises the CV1-L-TR (sizes the impulse chamber on top of CV1::Init).</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>One-step distributor advance for CV1-L-TR (impulse chamber + DCV).</summary>
|
/// <summary>One-step distributor advance for CV1-L-TR (impulse chamber + DCV).</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
||||||
void SetLBP(double const P); // cisnienie z hamulca pomocniczego
|
void SetLBP(double P); // cisnienie z hamulca pomocniczego
|
||||||
/// <summary>Computes the high-pressure (8 bar) inflow used to replenish the auxiliary reservoir.</summary>
|
/// <summary>Computes the high-pressure (8 bar) inflow used to replenish the auxiliary reservoir.</summary>
|
||||||
double GetHPFlow(double const HP, double const dt) /*override*/; // przeplyw - 8 bar
|
double GetHPFlow(double HP, double dt) /*override*/; // przeplyw - 8 bar
|
||||||
|
|
||||||
/// <summary>Constructs the CV1-L-TR and creates the impulse chamber.</summary>
|
/// <summary>Constructs the CV1-L-TR and creates the impulse chamber.</summary>
|
||||||
inline TCV1L_TR(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TCV1(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TCV1L_TR(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TCV1(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
ImplsRes = std::make_shared<TReservoir>();
|
ImplsRes = std::make_shared<TReservoir>();
|
||||||
}
|
}
|
||||||
@@ -971,34 +971,34 @@ class TKE : public TBrake
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>Initialises the KE distributor (control / impulse / auxiliary reservoirs and BVM).</summary>
|
/// <summary>Initialises the KE distributor (control / impulse / auxiliary reservoirs and BVM).</summary>
|
||||||
void Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) /*override*/;
|
void Init(double PP, double HPP, double LPP, double BP, int BDF) /*override*/;
|
||||||
/// <summary>Sets the rapid step ratio (RM = 1 - RMR).</summary>
|
/// <summary>Sets the rapid step ratio (RM = 1 - RMR).</summary>
|
||||||
void SetRM(double const RMR); // ustalenie przelozenia rapida
|
void SetRM(double RMR); // ustalenie przelozenia rapida
|
||||||
/// <summary>One-step distributor advance for the KE distributor.</summary>
|
/// <summary>One-step distributor advance for the KE distributor.</summary>
|
||||||
double GetPF(double const PP, double const dt, double const Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
|
||||||
/// <summary>Computes the high-pressure (8 bar) inflow used to replenish the auxiliary reservoir.</summary>
|
/// <summary>Computes the high-pressure (8 bar) inflow used to replenish the auxiliary reservoir.</summary>
|
||||||
double GetHPFlow(double const HP, double const dt) /*override*/; // przeplyw - 8 bar
|
double GetHPFlow(double HP, double dt) /*override*/; // przeplyw - 8 bar
|
||||||
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
|
||||||
double GetCRP() /*override*/;
|
double GetCRP() /*override*/;
|
||||||
/// <summary>Updates BrakeStatus from cylinder/pre-chamber/control reservoir pressures (KE-specific thresholds).</summary>
|
/// <summary>Updates BrakeStatus from cylinder/pre-chamber/control reservoir pressures (KE-specific thresholds).</summary>
|
||||||
void CheckState(double const BCP, double &dV1);
|
void CheckState(double BCP, double &dV1);
|
||||||
/// <summary>Drives the releaser logic for KE — bleeds the control reservoir while engaged.</summary>
|
/// <summary>Drives the releaser logic for KE — bleeds the control reservoir while engaged.</summary>
|
||||||
void CheckReleaser(double const dt); // odluzniacz
|
void CheckReleaser(double dt); // odluzniacz
|
||||||
/// <summary>ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double CVs(double const BP); // napelniacz sterujacego
|
double CVs(double BP); // napelniacz sterujacego
|
||||||
/// <summary>ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
/// <summary>ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
|
||||||
double BVs(double const BCP); // napelniacz pomocniczego
|
double BVs(double BCP); // napelniacz pomocniczego
|
||||||
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
/// <summary>Recomputes LoadC for the current vehicle mass.</summary>
|
||||||
void PLC(double const mass); // wspolczynnik cisnienia przystawki wazacej
|
void PLC(double mass); // wspolczynnik cisnienia przystawki wazacej
|
||||||
/// <summary>Stores the load-weighing parameters.</summary>
|
/// <summary>Stores the load-weighing parameters.</summary>
|
||||||
void SetLP(double const TM, double const LM, double const TBP); // parametry przystawki wazacej
|
void SetLP(double TM, double LM, double TBP); // parametry przystawki wazacej
|
||||||
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
/// <summary>Sets the auxiliary brake target pressure for the DCV.</summary>
|
||||||
void SetLBP(double const P); // cisnienie z hamulca pomocniczego
|
void SetLBP(double P); // cisnienie z hamulca pomocniczego
|
||||||
/// <summary>Vents valve, brake, control, impulse and secondary auxiliary reservoirs to zero.</summary>
|
/// <summary>Vents valve, brake, control, impulse and secondary auxiliary reservoirs to zero.</summary>
|
||||||
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
|
||||||
|
|
||||||
/// <summary>Constructs the KE distributor and creates the control / impulse / secondary reservoirs.</summary>
|
/// <summary>Constructs the KE distributor and creates the control / impulse / secondary reservoirs.</summary>
|
||||||
inline TKE(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
TKE(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) : TBrake(i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
|
||||||
{
|
{
|
||||||
ImplsRes = std::make_shared<TReservoir>();
|
ImplsRes = std::make_shared<TReservoir>();
|
||||||
CntrlRes = std::make_shared<TReservoir>();
|
CntrlRes = std::make_shared<TReservoir>();
|
||||||
@@ -1085,7 +1085,7 @@ class TDriverHandle
|
|||||||
/// <param name="flag">Combined ub_* flags.</param>
|
/// <param name="flag">Combined ub_* flags.</param>
|
||||||
virtual void SetUniversalFlag(int flag); // przycisk uniwersalny
|
virtual void SetUniversalFlag(int flag); // przycisk uniwersalny
|
||||||
/// <summary>Default constructor — clears the Sounds[] array.</summary>
|
/// <summary>Default constructor — clears the Sounds[] array.</summary>
|
||||||
inline TDriverHandle()
|
TDriverHandle()
|
||||||
{
|
{
|
||||||
memset(Sounds, 0, sizeof(Sounds));
|
memset(Sounds, 0, sizeof(Sounds));
|
||||||
}
|
}
|
||||||
@@ -1112,7 +1112,7 @@ class TFV4a : public TDriverHandle
|
|||||||
void Init(double Press) /*override*/;
|
void Init(double Press) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TFV4a() : TDriverHandle() {}
|
TFV4a() : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1163,7 +1163,7 @@ class TFV4aM : public TDriverHandle
|
|||||||
/// <summary>Returns the regulator pressure (5 + TP*0.08 + RedAdj).</summary>
|
/// <summary>Returns the regulator pressure (5 + TP*0.08 + RedAdj).</summary>
|
||||||
double GetRP();
|
double GetRP();
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TFV4aM() : TDriverHandle() {}
|
TFV4aM() : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1217,7 +1217,7 @@ class TMHZ_EN57 : public TDriverHandle
|
|||||||
/// <summary>Configures handle parameters (auto/manual overcharge, over-pressure, overcharge dynamics).</summary>
|
/// <summary>Configures handle parameters (auto/manual overcharge, over-pressure, overcharge dynamics).</summary>
|
||||||
void SetParams(bool AO, bool MO, double OverP, double, double OMP, double OPD);
|
void SetParams(bool AO, bool MO, double OverP, double, double OMP, double OPD);
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TMHZ_EN57(void) : TDriverHandle() {}
|
TMHZ_EN57(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1270,7 +1270,7 @@ class TMHZ_K5P : public TDriverHandle
|
|||||||
void SetParams(bool AO, bool MO, double, double, double OMP, double OPD); /*ovveride*/
|
void SetParams(bool AO, bool MO, double, double, double OMP, double OPD); /*ovveride*/
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TMHZ_K5P(void) : TDriverHandle() {}
|
TMHZ_K5P(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1323,7 +1323,7 @@ class TMHZ_6P : public TDriverHandle
|
|||||||
void SetParams(bool AO, bool MO, double, double, double OMP, double OPD); /*ovveride*/
|
void SetParams(bool AO, bool MO, double, double, double OMP, double OPD); /*ovveride*/
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TMHZ_6P(void) : TDriverHandle() {}
|
TMHZ_6P(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* FBS2= class(TTDriverHandle)
|
/* FBS2= class(TTDriverHandle)
|
||||||
@@ -1385,7 +1385,7 @@ class TM394 : public TDriverHandle
|
|||||||
double GetPos(int i) /*override*/;
|
double GetPos(int i) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor — sets the maximum handle position to 5.</summary>
|
/// <summary>Default constructor — sets the maximum handle position to 5.</summary>
|
||||||
inline TM394(void) : TDriverHandle()
|
TM394(void) : TDriverHandle()
|
||||||
{
|
{
|
||||||
i_bcpno = 5;
|
i_bcpno = 5;
|
||||||
}
|
}
|
||||||
@@ -1424,7 +1424,7 @@ class TH14K1 : public TDriverHandle
|
|||||||
double GetPos(int i) /*override*/;
|
double GetPos(int i) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor — sets the maximum handle position to 4.</summary>
|
/// <summary>Default constructor — sets the maximum handle position to 4.</summary>
|
||||||
inline TH14K1(void) : TDriverHandle()
|
TH14K1(void) : TDriverHandle()
|
||||||
{
|
{
|
||||||
i_bcpno = 4;
|
i_bcpno = 4;
|
||||||
}
|
}
|
||||||
@@ -1463,7 +1463,7 @@ class TSt113 : public TH14K1
|
|||||||
void Init(double Press) /*override*/;
|
void Init(double Press) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TSt113(void) : TH14K1() {}
|
TSt113(void) : TH14K1() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1484,7 +1484,7 @@ class Ttest : public TDriverHandle
|
|||||||
void Init(double Press) /*override*/;
|
void Init(double Press) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline Ttest(void) : TDriverHandle() {}
|
Ttest(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1515,7 +1515,7 @@ class TFD1 : public TDriverHandle
|
|||||||
// procedure Init(press: real; MaxBP: real); overload;
|
// procedure Init(press: real; MaxBP: real); overload;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TFD1(void) : TDriverHandle() {}
|
TFD1(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1540,7 +1540,7 @@ class TH1405 : public TDriverHandle
|
|||||||
// procedure Init(press: real; MaxBP: real); overload;
|
// procedure Init(press: real; MaxBP: real); overload;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TH1405(void) : TDriverHandle() {}
|
TH1405(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1574,7 +1574,7 @@ class TFVel6 : public TDriverHandle
|
|||||||
void Init(double Press) /*override*/;
|
void Init(double Press) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TFVel6(void) : TDriverHandle() {}
|
TFVel6(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1609,7 +1609,7 @@ class TFVE408 : public TDriverHandle
|
|||||||
void Init(double Press) /*override*/;
|
void Init(double Press) /*override*/;
|
||||||
|
|
||||||
/// <summary>Default constructor.</summary>
|
/// <summary>Default constructor.</summary>
|
||||||
inline TFVE408(void) : TDriverHandle() {}
|
TFVE408(void) : TDriverHandle() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1622,7 +1622,7 @@ class TFVE408 : public TDriverHandle
|
|||||||
/// <param name="S">Effective orifice cross-section.</param>
|
/// <param name="S">Effective orifice cross-section.</param>
|
||||||
/// <param name="DP">Soft-clip pressure delta — softens flow for tiny PH-PL differences (default 0.25).</param>
|
/// <param name="DP">Soft-clip pressure delta — softens flow for tiny PH-PL differences (default 0.25).</param>
|
||||||
/// <returns>Volumetric flow rate (signed; positive = P1->P2 direction).</returns>
|
/// <returns>Volumetric flow rate (signed; positive = P1->P2 direction).</returns>
|
||||||
extern double PF(double const P1, double const P2, double const S, double const DP = 0.25);
|
extern double PF(double P1, double P2, double S, double DP = 0.25);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Variant of <see cref="PF"/> that uses the dimensionless pressure ratio (sg)
|
/// Variant of <see cref="PF"/> that uses the dimensionless pressure ratio (sg)
|
||||||
/// for the soft-clip threshold instead of an absolute pressure delta.
|
/// for the soft-clip threshold instead of an absolute pressure delta.
|
||||||
@@ -1631,7 +1631,7 @@ extern double PF(double const P1, double const P2, double const S, double const
|
|||||||
/// <param name="P2">Destination pressure [bar].</param>
|
/// <param name="P2">Destination pressure [bar].</param>
|
||||||
/// <param name="S">Effective orifice cross-section.</param>
|
/// <param name="S">Effective orifice cross-section.</param>
|
||||||
/// <returns>Volumetric flow rate.</returns>
|
/// <returns>Volumetric flow rate.</returns>
|
||||||
extern double PF1(double const P1, double const P2, double const S);
|
extern double PF1(double P1, double P2, double S);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Filling valve flow: flows from PH to PL until PL reaches LIM. The valve
|
/// Filling valve flow: flows from PH to PL until PL reaches LIM. The valve
|
||||||
@@ -1644,7 +1644,7 @@ extern double PF1(double const P1, double const P2, double const S);
|
|||||||
/// <param name="LIM">Target pressure for PL [bar].</param>
|
/// <param name="LIM">Target pressure for PL [bar].</param>
|
||||||
/// <param name="DP">Throttling distance from LIM (default 0.1).</param>
|
/// <param name="DP">Throttling distance from LIM (default 0.1).</param>
|
||||||
/// <returns>Flow rate from PH to PL (positive into PL).</returns>
|
/// <returns>Flow rate from PH to PL (positive into PL).</returns>
|
||||||
extern double PFVa(double PH, double PL, double const S, double LIM, double const DP = 0.1); // zawor napelniajacy z PH do PL, PL do LIM
|
extern double PFVa(double PH, double PL, double S, double LIM, double DP = 0.1); // zawor napelniajacy z PH do PL, PL do LIM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Venting valve flow: flows from PH to PL until PH falls to LIM. The valve
|
/// Venting valve flow: flows from PH to PL until PH falls to LIM. The valve
|
||||||
/// throttles smoothly as PH approaches LIM. Returns 0 once PH <= LIM.
|
/// throttles smoothly as PH approaches LIM. Returns 0 once PH <= LIM.
|
||||||
@@ -1655,4 +1655,4 @@ extern double PFVa(double PH, double PL, double const S, double LIM, double cons
|
|||||||
/// <param name="LIM">Lower bound for PH [bar].</param>
|
/// <param name="LIM">Lower bound for PH [bar].</param>
|
||||||
/// <param name="DP">Throttling distance from LIM (default 0.1).</param>
|
/// <param name="DP">Throttling distance from LIM (default 0.1).</param>
|
||||||
/// <returns>Flow rate from PH to PL.</returns>
|
/// <returns>Flow rate from PH to PL.</returns>
|
||||||
extern double PFVd(double PH, double PL, double const S, double LIM, double const DP = 0.1); // zawor wypuszczajacy z PH do PL, PH do LIM
|
extern double PFVd(double PH, double PL, double S, double LIM, double DP = 0.1); // zawor wypuszczajacy z PH do PL, PH do LIM
|
||||||
|
|||||||
@@ -59,29 +59,29 @@ public:
|
|||||||
bool
|
bool
|
||||||
pop_mode();
|
pop_mode();
|
||||||
bool
|
bool
|
||||||
push_mode( mode const Mode );
|
push_mode( mode Mode );
|
||||||
void
|
void
|
||||||
set_title( std::string const &Title );
|
set_title( std::string const &Title );
|
||||||
void
|
void
|
||||||
set_progress( float const Progress = 0.f, float const Subtaskprogress = 0.f );
|
set_progress( float Progress = 0.f, float Subtaskprogress = 0.f );
|
||||||
void
|
void
|
||||||
set_tooltip( std::string const &Tooltip );
|
set_tooltip( std::string const &Tooltip );
|
||||||
void
|
void
|
||||||
set_cursor( int const Mode );
|
set_cursor( int Mode );
|
||||||
void
|
void
|
||||||
set_cursor_pos( double const Horizontal, double const Vertical );
|
set_cursor_pos( double Horizontal, double Vertical );
|
||||||
void queue_screenshot();
|
void queue_screenshot();
|
||||||
// input handlers
|
// input handlers
|
||||||
void on_key( int const Key, int const Scancode, int const Action, int const Mods );
|
void on_key( int Key, int Scancode, int Action, int Mods );
|
||||||
void on_char( unsigned int const Char );
|
void on_char( unsigned int Char );
|
||||||
void on_cursor_pos( double const Horizontal, double const Vertical );
|
void on_cursor_pos( double Horizontal, double Vertical );
|
||||||
void on_mouse_button( int const Button, int const Action, int const Mods );
|
void on_mouse_button( int Button, int Action, int Mods );
|
||||||
void on_scroll( double const Xoffset, double const Yoffset );
|
void on_scroll( double Xoffset, double Yoffset );
|
||||||
void on_focus_change(bool focus);
|
void on_focus_change(bool focus);
|
||||||
void on_window_resize(int w, int h);
|
void on_window_resize(int w, int h);
|
||||||
// gives access to specified window, creates a new window if index == -1
|
// gives access to specified window, creates a new window if index == -1
|
||||||
GLFWwindow *
|
GLFWwindow *
|
||||||
window( int const Windowindex = 0, bool visible = false, int width = 1, int height = 1, GLFWmonitor *monitor = nullptr, bool keep_ownership = true, bool share_ctx = true );
|
window( int Windowindex = 0, bool visible = false, int width = 1, int height = 1, GLFWmonitor *monitor = nullptr, bool keep_ownership = true, bool share_ctx = true );
|
||||||
GLFWmonitor * find_monitor( const std::string &str ) const;
|
GLFWmonitor * find_monitor( const std::string &str ) const;
|
||||||
std::string describe_monitor( GLFWmonitor *monitor ) const;
|
std::string describe_monitor( GLFWmonitor *monitor ) const;
|
||||||
// generate network sync verification number
|
// generate network sync verification number
|
||||||
|
|||||||
@@ -24,20 +24,16 @@ public:
|
|||||||
// mode-specific update of simulation data. returns: false on error, true otherwise
|
// mode-specific update of simulation data. returns: false on error, true otherwise
|
||||||
virtual bool update() = 0;
|
virtual bool update() = 0;
|
||||||
// draws mode-specific user interface
|
// draws mode-specific user interface
|
||||||
inline
|
void render_ui() {
|
||||||
void render_ui() {
|
|
||||||
if( m_userinterface != nullptr ) {
|
if( m_userinterface != nullptr ) {
|
||||||
m_userinterface->render(); } }
|
m_userinterface->render(); } }
|
||||||
inline
|
|
||||||
void begin_ui_frame() {
|
void begin_ui_frame() {
|
||||||
if( m_userinterface != nullptr ) {
|
if( m_userinterface != nullptr ) {
|
||||||
m_userinterface->begin_ui_frame(); } }
|
m_userinterface->begin_ui_frame(); } }
|
||||||
inline
|
void set_progress( float const Progress = 0.f, float const Subtaskprogress = 0.f ) {
|
||||||
void set_progress( float const Progress = 0.f, float const Subtaskprogress = 0.f ) {
|
|
||||||
if( m_userinterface != nullptr ) {
|
if( m_userinterface != nullptr ) {
|
||||||
m_userinterface->set_progress( Progress, Subtaskprogress ); } }
|
m_userinterface->set_progress( Progress, Subtaskprogress ); } }
|
||||||
inline
|
void set_tooltip( std::string const &Tooltip ) {
|
||||||
void set_tooltip( std::string const &Tooltip ) {
|
|
||||||
if( m_userinterface != nullptr ) {
|
if( m_userinterface != nullptr ) {
|
||||||
m_userinterface->set_tooltip( Tooltip ); } }
|
m_userinterface->set_tooltip( Tooltip ); } }
|
||||||
// maintenance method, called when the mode is activated
|
// maintenance method, called when the mode is activated
|
||||||
|
|||||||
@@ -86,18 +86,18 @@ private:
|
|||||||
std::string
|
std::string
|
||||||
binding_hints( std::pair<user_command, user_command> const &Commands ) const;
|
binding_hints( std::pair<user_command, user_command> const &Commands ) const;
|
||||||
std::pair<user_command, user_command>
|
std::pair<user_command, user_command>
|
||||||
command_fallback( user_command const Command ) const;
|
command_fallback( user_command Command ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
void update_camera( const double Deltatime );
|
void update_camera(double Deltatime );
|
||||||
// handles vehicle change flag
|
// handles vehicle change flag
|
||||||
void OnKeyDown( int cKey );
|
void OnKeyDown( int cKey );
|
||||||
void InOutKey();
|
void InOutKey();
|
||||||
void CabView();
|
void CabView();
|
||||||
void ExternalView();
|
void ExternalView();
|
||||||
void DistantView( bool const Near = false );
|
void DistantView( bool Near = false );
|
||||||
void set_picking( bool const Picking );
|
void set_picking( bool Picking );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
drivermode_input m_input;
|
drivermode_input m_input;
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ public:
|
|||||||
void showDebugUI() override;
|
void showDebugUI() override;
|
||||||
// potentially processes provided input key. returns: true if the input was processed, false otherwise
|
// potentially processes provided input key. returns: true if the input was processed, false otherwise
|
||||||
bool
|
bool
|
||||||
on_key( int const Key, int const Action ) override;
|
on_key( int Key, int Action ) override;
|
||||||
// potentially processes provided mouse movement. returns: true if the input was processed, false otherwise
|
// potentially processes provided mouse movement. returns: true if the input was processed, false otherwise
|
||||||
bool
|
bool
|
||||||
on_cursor_pos( double const Horizontal, double const Vertical ) override;
|
on_cursor_pos( double Horizontal, double Vertical ) override;
|
||||||
// potentially processes provided mouse button. returns: true if the input was processed, false otherwise
|
// potentially processes provided mouse button. returns: true if the input was processed, false otherwise
|
||||||
bool
|
bool
|
||||||
on_mouse_button( int const Button, int const Action ) override;
|
on_mouse_button( int Button, int Action ) override;
|
||||||
// updates state of UI elements
|
// updates state of UI elements
|
||||||
void
|
void
|
||||||
update() override;
|
update() override;
|
||||||
@@ -49,7 +49,7 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
// sets visibility of the cursor
|
// sets visibility of the cursor
|
||||||
void
|
void
|
||||||
set_cursor( bool const Visible );
|
set_cursor( bool Visible );
|
||||||
// render() subclass details
|
// render() subclass details
|
||||||
void
|
void
|
||||||
render_() override;
|
render_() override;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ private:
|
|||||||
void update_section_uart( std::vector<text_line> &Output );
|
void update_section_uart( std::vector<text_line> &Output );
|
||||||
#endif
|
#endif
|
||||||
// section update helpers
|
// section update helpers
|
||||||
std::string update_vehicle_coupler( int const Side );
|
std::string update_vehicle_coupler( int Side );
|
||||||
std::string update_vehicle_brake() const;
|
std::string update_vehicle_brake() const;
|
||||||
// renders provided lines, under specified collapsing header
|
// renders provided lines, under specified collapsing header
|
||||||
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
|
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
|
||||||
|
|||||||
@@ -48,19 +48,19 @@ namespace
|
|||||||
using vec3 = glm::vec3;
|
using vec3 = glm::vec3;
|
||||||
using dvec2 = glm::dvec2;
|
using dvec2 = glm::dvec2;
|
||||||
|
|
||||||
inline bool is_release(int state)
|
bool is_release(int state)
|
||||||
{
|
{
|
||||||
return state == GLFW_RELEASE;
|
return state == GLFW_RELEASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool is_press(int state)
|
bool is_press(int state)
|
||||||
{
|
{
|
||||||
return state == GLFW_PRESS;
|
return state == GLFW_PRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests whether the vertical line through (Px,Pz) passes over triangle abc; if so returns the
|
// tests whether the vertical line through (Px,Pz) passes over triangle abc; if so returns the
|
||||||
// surface height at that point through OutY. used by the "snap to ground" (END) feature.
|
// surface height at that point through OutY. used by the "snap to ground" (END) feature.
|
||||||
inline bool triangle_height_at(glm::dvec3 const &a, glm::dvec3 const &b, glm::dvec3 const &c,
|
bool triangle_height_at(glm::dvec3 const &a, glm::dvec3 const &b, glm::dvec3 const &c,
|
||||||
double const Px, double const Pz, double &OutY)
|
double const Px, double const Pz, double &OutY)
|
||||||
{
|
{
|
||||||
double const ux = b.x - a.x, uz = b.z - a.z;
|
double const ux = b.x - a.x, uz = b.z - a.z;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class editor_mode : public application_mode
|
|||||||
std::vector<EditorSnapshot> m_history; // history of changes to nodes, used for undo functionality
|
std::vector<EditorSnapshot> m_history; // history of changes to nodes, used for undo functionality
|
||||||
std::vector<EditorSnapshot> g_redo;
|
std::vector<EditorSnapshot> g_redo;
|
||||||
// methods
|
// methods
|
||||||
void update_camera(double const Deltatime);
|
void update_camera(double Deltatime);
|
||||||
|
|
||||||
editor_ui *ui() const;
|
editor_ui *ui() const;
|
||||||
void redo_last();
|
void redo_last();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class brush_object_list : public ui_panel
|
|||||||
std::string Template;
|
std::string Template;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
brush_object_list(std::string const &Name, bool const Isopen);
|
brush_object_list(std::string const &Name, bool Isopen);
|
||||||
void render() override;
|
void render() override;
|
||||||
void update(std::string nodeTemplate);
|
void update(std::string nodeTemplate);
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ class nodebank_panel : public ui_panel
|
|||||||
};
|
};
|
||||||
edit_mode mode = MODIFY;
|
edit_mode mode = MODIFY;
|
||||||
|
|
||||||
nodebank_panel(std::string const &Name, bool const Isopen);
|
nodebank_panel(std::string const &Name, bool Isopen);
|
||||||
void nodebank_reload();
|
void nodebank_reload();
|
||||||
void render() override;
|
void render() override;
|
||||||
void add_template(const std::string &desc);
|
void add_template(const std::string &desc);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
create( std::string const &Filename );
|
create( std::string const &Filename );
|
||||||
// provides direct access to a specified buffer
|
// provides direct access to a specified buffer
|
||||||
openal_buffer const &
|
openal_buffer const &
|
||||||
buffer( buffer_handle const Buffer ) const;
|
buffer( buffer_handle Buffer ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ struct openal_source {
|
|||||||
play();
|
play();
|
||||||
// updates state of the source
|
// updates state of the source
|
||||||
void
|
void
|
||||||
update( double const Deltatime, glm::vec3 const &Listenervelocity );
|
update( double Deltatime, glm::vec3 const &Listenervelocity );
|
||||||
// configures state of the source to match the provided set of properties
|
// configures state of the source to match the provided set of properties
|
||||||
void
|
void
|
||||||
sync_with( sound_properties const &State );
|
sync_with( sound_properties const &State );
|
||||||
@@ -85,13 +85,13 @@ struct openal_source {
|
|||||||
stop();
|
stop();
|
||||||
// toggles looping of the sound emitted by the source
|
// toggles looping of the sound emitted by the source
|
||||||
void
|
void
|
||||||
loop( bool const State );
|
loop( bool State );
|
||||||
// sets max audible distance for sounds emitted by the source
|
// sets max audible distance for sounds emitted by the source
|
||||||
void
|
void
|
||||||
range( float const Range );
|
range( float Range );
|
||||||
// sets modifier applied to the pitch of sounds emitted by the source
|
// sets modifier applied to the pitch of sounds emitted by the source
|
||||||
void
|
void
|
||||||
pitch( float const Pitch );
|
pitch( float Pitch );
|
||||||
// releases bound buffers and resets state of the class variables
|
// releases bound buffers and resets state of the class variables
|
||||||
// NOTE: doesn't release allocated implementation-side source
|
// NOTE: doesn't release allocated implementation-side source
|
||||||
void
|
void
|
||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
fetch_buffer( std::string const &Filename );
|
fetch_buffer( std::string const &Filename );
|
||||||
// provides direct access to a specified buffer
|
// provides direct access to a specified buffer
|
||||||
openal_buffer const &
|
openal_buffer const &
|
||||||
buffer( buffer_handle const Buffer ) const;
|
buffer( buffer_handle Buffer ) const;
|
||||||
// core methods
|
// core methods
|
||||||
// initializes the service
|
// initializes the service
|
||||||
bool
|
bool
|
||||||
@@ -141,7 +141,7 @@ public:
|
|||||||
erase( sound_source const *Controller );
|
erase( sound_source const *Controller );
|
||||||
// updates state of all active emitters
|
// updates state of all active emitters
|
||||||
void
|
void
|
||||||
update( double const Deltatime );
|
update( double Deltatime );
|
||||||
|
|
||||||
glm::dvec3 cached_camerapos;
|
glm::dvec3 cached_camerapos;
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class sound_source {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// constructors
|
// constructors
|
||||||
sound_source( sound_placement const Placement = sound_placement::general, float const Range = 50.f );
|
sound_source( sound_placement Placement = sound_placement::general, float Range = 50.f );
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
~sound_source();
|
~sound_source();
|
||||||
@@ -66,9 +66,9 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// restores state of the class from provided data stream
|
// restores state of the class from provided data stream
|
||||||
sound_source &
|
sound_source &
|
||||||
deserialize( cParser &Input, sound_type const Legacytype, int const Legacyparameters = 0, int const Chunkrange = 100 );
|
deserialize( cParser &Input, sound_type Legacytype, int Legacyparameters = 0, int Chunkrange = 100 );
|
||||||
sound_source &
|
sound_source &
|
||||||
deserialize( std::string const &Input, sound_type const Legacytype, int const Legacyparameters = 0 );
|
deserialize( std::string const &Input, sound_type Legacytype, int Legacyparameters = 0 );
|
||||||
// sends content of the class in legacy (text) format to provided stream
|
// sends content of the class in legacy (text) format to provided stream
|
||||||
void
|
void
|
||||||
export_as_text( std::ostream &Output ) const;
|
export_as_text( std::ostream &Output ) const;
|
||||||
@@ -77,25 +77,25 @@ public:
|
|||||||
copy_sounds( sound_source const &Source );
|
copy_sounds( sound_source const &Source );
|
||||||
// issues contextual play commands for the audio renderer
|
// issues contextual play commands for the audio renderer
|
||||||
void
|
void
|
||||||
play( int const Flags = 0 );
|
play( int Flags = 0 );
|
||||||
// maintains playback of sounds started by event
|
// maintains playback of sounds started by event
|
||||||
void
|
void
|
||||||
play_event();
|
play_event();
|
||||||
// stops currently active play commands controlled by this emitter
|
// stops currently active play commands controlled by this emitter
|
||||||
void
|
void
|
||||||
stop( bool const Skipend = false );
|
stop( bool Skipend = false );
|
||||||
// adjusts parameters of provided implementation-side sound source
|
// adjusts parameters of provided implementation-side sound source
|
||||||
void
|
void
|
||||||
update( audio::openal_source &Source );
|
update( audio::openal_source &Source );
|
||||||
// sets base volume of the emiter to specified value
|
// sets base volume of the emiter to specified value
|
||||||
sound_source &
|
sound_source &
|
||||||
gain( float const Gain );
|
gain( float Gain );
|
||||||
// returns current base volume of the emitter
|
// returns current base volume of the emitter
|
||||||
float
|
float
|
||||||
gain() const;
|
gain() const;
|
||||||
// sets base pitch of the emitter to specified value
|
// sets base pitch of the emitter to specified value
|
||||||
sound_source &
|
sound_source &
|
||||||
pitch( float const Pitch );
|
pitch( float Pitch );
|
||||||
// owner setter/getter
|
// owner setter/getter
|
||||||
void
|
void
|
||||||
owner( TDynamicObject const *Owner );
|
owner( TDynamicObject const *Owner );
|
||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
owner() const;
|
owner() const;
|
||||||
// sound source offset setter/getter
|
// sound source offset setter/getter
|
||||||
void
|
void
|
||||||
offset( glm::vec3 const Offset );
|
offset( glm::vec3 Offset );
|
||||||
glm::vec3 const &
|
glm::vec3 const &
|
||||||
offset() const;
|
offset() const;
|
||||||
// sound source name setter/getter
|
// sound source name setter/getter
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
name() const;
|
name() const;
|
||||||
// playback starting point shift setter/getter
|
// playback starting point shift setter/getter
|
||||||
void
|
void
|
||||||
start( float const Offset );
|
start( float Offset );
|
||||||
float const &
|
float const &
|
||||||
start() const;
|
start() const;
|
||||||
// custom soundproofing setter/getter
|
// custom soundproofing setter/getter
|
||||||
@@ -126,13 +126,13 @@ public:
|
|||||||
empty() const;
|
empty() const;
|
||||||
// returns true if the source is emitting any sound; by default doesn't take into account optional ending soudnds
|
// returns true if the source is emitting any sound; by default doesn't take into account optional ending soudnds
|
||||||
bool
|
bool
|
||||||
is_playing( bool const Includesoundends = false ) const;
|
is_playing( bool Includesoundends = false ) const;
|
||||||
// returns true if the source uses sample table
|
// returns true if the source uses sample table
|
||||||
bool
|
bool
|
||||||
is_combined() const;
|
is_combined() const;
|
||||||
// returns true if specified buffer is one of the optional bookends
|
// returns true if specified buffer is one of the optional bookends
|
||||||
bool
|
bool
|
||||||
is_bookend( audio::buffer_handle const Buffer ) const;
|
is_bookend( audio::buffer_handle Buffer ) const;
|
||||||
// returns true if the source has optional bookends
|
// returns true if the source has optional bookends
|
||||||
bool
|
bool
|
||||||
has_bookends() const;
|
has_bookends() const;
|
||||||
@@ -141,7 +141,7 @@ public:
|
|||||||
location() const;
|
location() const;
|
||||||
// returns defined range of the sound
|
// returns defined range of the sound
|
||||||
void
|
void
|
||||||
range( float const Range );
|
range( float Range );
|
||||||
float const
|
float const
|
||||||
range() const;
|
range() const;
|
||||||
|
|
||||||
@@ -196,16 +196,16 @@ private:
|
|||||||
void
|
void
|
||||||
update_combined( audio::openal_source &Source );
|
update_combined( audio::openal_source &Source );
|
||||||
void
|
void
|
||||||
update_crossfade( sound_handle const Chunk );
|
update_crossfade( sound_handle Chunk );
|
||||||
void
|
void
|
||||||
update_counter( sound_handle const Sound, int const Value );
|
update_counter( sound_handle Sound, int Value );
|
||||||
void
|
void
|
||||||
update_location();
|
update_location();
|
||||||
// potentially updates area-based gain factor of the source. returns: true if location has changed
|
// potentially updates area-based gain factor of the source. returns: true if location has changed
|
||||||
bool
|
bool
|
||||||
update_soundproofing();
|
update_soundproofing();
|
||||||
void
|
void
|
||||||
insert( sound_handle const Sound );
|
insert( sound_handle Sound );
|
||||||
template <class Iterator_>
|
template <class Iterator_>
|
||||||
void
|
void
|
||||||
insert( Iterator_ First, Iterator_ Last ) {
|
insert( Iterator_ First, Iterator_ Last ) {
|
||||||
@@ -219,9 +219,9 @@ private:
|
|||||||
sounds.emplace_back( soundhandle ); } );
|
sounds.emplace_back( soundhandle ); } );
|
||||||
audio::renderer.insert( std::begin( buffers ), std::end( buffers ), this, sounds ); }
|
audio::renderer.insert( std::begin( buffers ), std::end( buffers ), this, sounds ); }
|
||||||
sound_data &
|
sound_data &
|
||||||
sound( sound_handle const Sound );
|
sound( sound_handle Sound );
|
||||||
sound_data const &
|
sound_data const &
|
||||||
sound( sound_handle const Sound ) const;
|
sound( sound_handle Sound ) const;
|
||||||
|
|
||||||
// members
|
// members
|
||||||
TDynamicObject const * m_owner { nullptr }; // optional, the vehicle carrying this sound source
|
TDynamicObject const * m_owner { nullptr }; // optional, the vehicle carrying this sound source
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public:
|
|||||||
|
|
||||||
// methods:
|
// methods:
|
||||||
void init();
|
void init();
|
||||||
void update( bool const Includephase = false );
|
void update( bool Includephase = false );
|
||||||
void render();
|
void render();
|
||||||
// returns vector pointing at the sun
|
// returns vector pointing at the sun
|
||||||
glm::vec3 getDirection() const;
|
glm::vec3 getDirection() const;
|
||||||
@@ -22,13 +22,13 @@ public:
|
|||||||
// returns current phase of the moon
|
// returns current phase of the moon
|
||||||
float getPhase() const { return m_phase; }
|
float getPhase() const { return m_phase; }
|
||||||
// sets current time, overriding one acquired from the system clock
|
// sets current time, overriding one acquired from the system clock
|
||||||
void setTime( int const Hour, int const Minute, int const Second );
|
void setTime( int Hour, int Minute, int Second );
|
||||||
// sets current geographic location
|
// sets current geographic location
|
||||||
void setLocation( float const Longitude, float const Latitude );
|
void setLocation( float Longitude, float Latitude );
|
||||||
// sets ambient temperature in degrees C.
|
// sets ambient temperature in degrees C.
|
||||||
void setTemperature( float const Temperature );
|
void setTemperature( float Temperature );
|
||||||
// sets surface pressure in milibars
|
// sets surface pressure in milibars
|
||||||
void setPressure( float const Pressure );
|
void setPressure( float Pressure );
|
||||||
|
|
||||||
// constructors:
|
// constructors:
|
||||||
cMoon();
|
cMoon();
|
||||||
@@ -50,7 +50,7 @@ protected:
|
|||||||
void irradiance();
|
void irradiance();
|
||||||
void phase();
|
void phase();
|
||||||
// helper, normalize values to range 0...1
|
// helper, normalize values to range 0...1
|
||||||
float normalize( const float Value ) const;
|
float normalize(float Value ) const;
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
|
|
||||||
class CSkyDome {
|
class CSkyDome {
|
||||||
public:
|
public:
|
||||||
CSkyDome( int const Tesselation = 54 );
|
CSkyDome( int Tesselation = 54 );
|
||||||
~CSkyDome();
|
~CSkyDome();
|
||||||
void Generate();
|
void Generate();
|
||||||
void RebuildColors();
|
void RebuildColors();
|
||||||
|
|
||||||
bool SetSunPosition( glm::vec3 const &Direction );
|
bool SetSunPosition( glm::vec3 const &Direction );
|
||||||
|
|
||||||
void SetTurbidity( const float Turbidity = 5.0f );
|
void SetTurbidity(float Turbidity = 5.0f );
|
||||||
void SetExposure( const bool Linearexposure, const float Expfactor );
|
void SetExposure(bool Linearexposure, float Expfactor );
|
||||||
void SetOvercastFactor( const float Overcast = 0.0f );
|
void SetOvercastFactor(float Overcast = 0.0f );
|
||||||
|
|
||||||
// update skydome
|
// update skydome
|
||||||
void Update( glm::vec3 const &Sun );
|
void Update( glm::vec3 const &Sun );
|
||||||
@@ -59,9 +59,9 @@ private:
|
|||||||
static float m_zenithymatrix[ 3 ][ 4 ];
|
static float m_zenithymatrix[ 3 ][ 4 ];
|
||||||
|
|
||||||
// coloring
|
// coloring
|
||||||
void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], const float Turbidity );
|
void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], float Turbidity );
|
||||||
float GetZenith( float Zenithmatrix[ 3 ][ 4 ], const float Theta, const float Turbidity );
|
float GetZenith( float Zenithmatrix[ 3 ][ 4 ], float Theta, float Turbidity );
|
||||||
float PerezFunctionO1( float Perezcoeffs[ 5 ], const float Thetasun, const float Zenithval );
|
float PerezFunctionO1( float Perezcoeffs[ 5 ], float Thetasun, float Zenithval );
|
||||||
float PerezFunctionO2( float Perezcoeffs[ 5 ], const float Icostheta, const float Gamma, const float Cosgamma2, const float Zenithval );
|
float PerezFunctionO2( float Perezcoeffs[ 5 ], float Icostheta, float Gamma, float Cosgamma2, float Zenithval );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ public:
|
|||||||
// returns current intensity of the sun
|
// returns current intensity of the sun
|
||||||
float getIntensity();
|
float getIntensity();
|
||||||
// sets current time, overriding one acquired from the system clock
|
// sets current time, overriding one acquired from the system clock
|
||||||
void setTime( int const Hour, int const Minute, int const Second );
|
void setTime( int Hour, int Minute, int Second );
|
||||||
// sets current geographic location
|
// sets current geographic location
|
||||||
void setLocation( float const Longitude, float const Latitude );
|
void setLocation( float Longitude, float Latitude );
|
||||||
// sets ambient temperature in degrees C.
|
// sets ambient temperature in degrees C.
|
||||||
void setTemperature( float const Temperature );
|
void setTemperature( float Temperature );
|
||||||
// sets surface pressure in milibars
|
// sets surface pressure in milibars
|
||||||
void setPressure( float const Pressure );
|
void setPressure( float Pressure );
|
||||||
|
|
||||||
// constructors:
|
// constructors:
|
||||||
cSun();
|
cSun();
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ namespace gl
|
|||||||
GLuint id = 0;
|
GLuint id = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline operator GLuint() const
|
operator GLuint() const
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator GLuint* const()
|
operator GLuint* const()
|
||||||
{
|
{
|
||||||
return &id;
|
return &id;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator const GLuint* const() const
|
operator const GLuint* const() const
|
||||||
{
|
{
|
||||||
return &id;
|
return &id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ namespace ImGuizmo
|
|||||||
|
|
||||||
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
|
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
|
||||||
IMGUI_API void DrawCubes(const float* view, const float* projection, const float* matrices, int matrixCount);
|
IMGUI_API void DrawCubes(const float* view, const float* projection, const float* matrices, int matrixCount);
|
||||||
IMGUI_API void DrawGrid(const float* view, const float* projection, const float* matrix, const float gridSize);
|
IMGUI_API void DrawGrid(const float* view, const float* projection, const float* matrix, float gridSize);
|
||||||
|
|
||||||
// call it when you want a gizmo
|
// call it when you want a gizmo
|
||||||
// Needs view and projection matrices.
|
// Needs view and projection matrices.
|
||||||
|
|||||||
122
imgui/imgui.h
122
imgui/imgui.h
@@ -1240,63 +1240,63 @@ struct ImVector
|
|||||||
typedef const value_type* const_iterator;
|
typedef const value_type* const_iterator;
|
||||||
|
|
||||||
// Constructors, destructor
|
// Constructors, destructor
|
||||||
inline ImVector() { Size = Capacity = 0; Data = NULL; }
|
ImVector() { Size = Capacity = 0; Data = NULL; }
|
||||||
inline ImVector(const ImVector<T>& src) { Size = Capacity = 0; Data = NULL; operator=(src); }
|
ImVector(const ImVector<T>& src) { Size = Capacity = 0; Data = NULL; operator=(src); }
|
||||||
inline ImVector<T>& operator=(const ImVector<T>& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; }
|
ImVector<T>& operator=(const ImVector<T>& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; }
|
||||||
inline ~ImVector() { if (Data) IM_FREE(Data); }
|
~ImVector() { if (Data) IM_FREE(Data); }
|
||||||
|
|
||||||
inline bool empty() const { return Size == 0; }
|
bool empty() const { return Size == 0; }
|
||||||
inline int size() const { return Size; }
|
int size() const { return Size; }
|
||||||
inline int size_in_bytes() const { return Size * (int)sizeof(T); }
|
int size_in_bytes() const { return Size * (int)sizeof(T); }
|
||||||
inline int capacity() const { return Capacity; }
|
int capacity() const { return Capacity; }
|
||||||
inline T& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; }
|
T & operator[](int i) { IM_ASSERT(i < Size); return Data[i]; }
|
||||||
inline const T& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; }
|
const T& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; }
|
||||||
|
|
||||||
inline void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } }
|
void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } }
|
||||||
inline T* begin() { return Data; }
|
T * begin() { return Data; }
|
||||||
inline const T* begin() const { return Data; }
|
const T* begin() const { return Data; }
|
||||||
inline T* end() { return Data + Size; }
|
T * end() { return Data + Size; }
|
||||||
inline const T* end() const { return Data + Size; }
|
const T* end() const { return Data + Size; }
|
||||||
inline T& front() { IM_ASSERT(Size > 0); return Data[0]; }
|
T & front() { IM_ASSERT(Size > 0); return Data[0]; }
|
||||||
inline const T& front() const { IM_ASSERT(Size > 0); return Data[0]; }
|
const T& front() const { IM_ASSERT(Size > 0); return Data[0]; }
|
||||||
inline T& back() { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
T & back() { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
||||||
inline const T& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
const T& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
||||||
inline void swap(ImVector<T>& rhs) {
|
void swap(ImVector<T>& rhs) {
|
||||||
const int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size;
|
const int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size;
|
||||||
const int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; T* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
|
const int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; T* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
|
||||||
|
|
||||||
inline int _grow_capacity(int sz) const {
|
int _grow_capacity(int sz) const {
|
||||||
const int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
const int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
||||||
inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
|
void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
|
||||||
inline void resize(int new_size, const T& v) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; }
|
void resize(int new_size, const T& v) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; }
|
||||||
inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
|
void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
|
||||||
|
|
||||||
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
|
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
|
||||||
inline void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; }
|
void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; }
|
||||||
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
||||||
inline void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
||||||
inline T* erase(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; }
|
T * erase(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; }
|
||||||
inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data+Size && it_last > it && it_last <= Data+Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - count) * sizeof(T)); Size -= (int)count; return Data + off; }
|
T * erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data+Size && it_last > it && it_last <= Data+Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - count) * sizeof(T)); Size -= (int)count; return Data + off; }
|
||||||
inline T* erase_unsorted(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; if (it < Data+Size-1) memcpy(Data + off, Data + Size - 1, sizeof(T)); Size--; return Data + off; }
|
T * erase_unsorted(const T* it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; if (it < Data+Size-1) memcpy(Data + off, Data + Size - 1, sizeof(T)); Size--; return Data + off; }
|
||||||
inline T* insert(const T* it, const T& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(T)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; }
|
T * insert(const T* it, const T& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(T)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; }
|
||||||
inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
|
bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
|
||||||
inline T* find(const T& v) { T* data = Data; const T* data_end = Data + Size; while (data < data_end)
|
T * find(const T& v) { T* data = Data; const T* data_end = Data + Size; while (data < data_end)
|
||||||
{
|
{
|
||||||
if (*data == v)
|
if (*data == v)
|
||||||
break;
|
break;
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
return data; }
|
return data; }
|
||||||
inline const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end)
|
const T* find(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end)
|
||||||
{
|
{
|
||||||
if (*data == v)
|
if (*data == v)
|
||||||
break;
|
break;
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
return data; }
|
return data; }
|
||||||
inline bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; }
|
bool find_erase(const T& v) { const T* it = find(v); if (it < Data + Size) { erase(it); return true; } return false; }
|
||||||
inline bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; }
|
bool find_erase_unsorted(const T& v) { const T* it = find(v); if (it < Data + Size) { erase_unsorted(it); return true; } return false; }
|
||||||
inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; return (int)off; }
|
int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; return (int)off; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1650,7 +1650,7 @@ struct ImGuiTextBuffer
|
|||||||
IMGUI_API static char EmptyString[1];
|
IMGUI_API static char EmptyString[1];
|
||||||
|
|
||||||
ImGuiTextBuffer() { }
|
ImGuiTextBuffer() { }
|
||||||
inline char operator[](int i) { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
|
char operator[](int i) { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
|
||||||
const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; }
|
const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; }
|
||||||
const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
|
const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
|
||||||
int size() const { return Buf.Size ? Buf.Size - 1 : 0; }
|
int size() const { return Buf.Size ? Buf.Size - 1 : 0; }
|
||||||
@@ -1778,11 +1778,11 @@ struct ImColor
|
|||||||
const float sc = 1.0f/255.0f; Value.x = (float)((rgba>>IM_COL32_R_SHIFT)&0xFF) * sc; Value.y = (float)((rgba>>IM_COL32_G_SHIFT)&0xFF) * sc; Value.z = (float)((rgba>>IM_COL32_B_SHIFT)&0xFF) * sc; Value.w = (float)((rgba>>IM_COL32_A_SHIFT)&0xFF) * sc; }
|
const float sc = 1.0f/255.0f; Value.x = (float)((rgba>>IM_COL32_R_SHIFT)&0xFF) * sc; Value.y = (float)((rgba>>IM_COL32_G_SHIFT)&0xFF) * sc; Value.z = (float)((rgba>>IM_COL32_B_SHIFT)&0xFF) * sc; Value.w = (float)((rgba>>IM_COL32_A_SHIFT)&0xFF) * sc; }
|
||||||
ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
|
ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
|
||||||
ImColor(const ImVec4& col) { Value = col; }
|
ImColor(const ImVec4& col) { Value = col; }
|
||||||
inline operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); }
|
operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); }
|
||||||
inline operator ImVec4() const { return Value; }
|
operator ImVec4() const { return Value; }
|
||||||
|
|
||||||
// FIXME-OBSOLETE: May need to obsolete/cleanup those helpers.
|
// FIXME-OBSOLETE: May need to obsolete/cleanup those helpers.
|
||||||
inline void SetHSV(float h, float s, float v, float a = 1.0f){ ImGui::ColorConvertHSVtoRGB(h, s, v, Value.x, Value.y, Value.z); Value.w = a; }
|
void SetHSV(float h, float s, float v, float a = 1.0f){ ImGui::ColorConvertHSVtoRGB(h, s, v, Value.x, Value.y, Value.z); Value.w = a; }
|
||||||
static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r,g,b,a); }
|
static ImColor HSV(float h, float s, float v, float a = 1.0f) { float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b); return ImColor(r,g,b,a); }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1862,9 +1862,9 @@ struct ImDrawListSplitter
|
|||||||
int _Count; // Number of active channels (1+)
|
int _Count; // Number of active channels (1+)
|
||||||
ImVector<ImDrawChannel> _Channels; // Draw channels (not resized down so _Count might be < Channels.Size)
|
ImVector<ImDrawChannel> _Channels; // Draw channels (not resized down so _Count might be < Channels.Size)
|
||||||
|
|
||||||
inline ImDrawListSplitter() { Clear(); }
|
ImDrawListSplitter() { Clear(); }
|
||||||
inline ~ImDrawListSplitter() { ClearFreeMemory(); }
|
~ImDrawListSplitter() { ClearFreeMemory(); }
|
||||||
inline void Clear() { _Current = 0; _Count = 1; } // Do not clear Channels[] so our allocations are reused next frame
|
void Clear() { _Current = 0; _Count = 1; } // Do not clear Channels[] so our allocations are reused next frame
|
||||||
IMGUI_API void ClearFreeMemory();
|
IMGUI_API void ClearFreeMemory();
|
||||||
IMGUI_API void Split(ImDrawList* draw_list, int count);
|
IMGUI_API void Split(ImDrawList* draw_list, int count);
|
||||||
IMGUI_API void Merge(ImDrawList* draw_list);
|
IMGUI_API void Merge(ImDrawList* draw_list);
|
||||||
@@ -1929,8 +1929,8 @@ struct ImDrawList
|
|||||||
IMGUI_API void PopClipRect();
|
IMGUI_API void PopClipRect();
|
||||||
IMGUI_API void PushTextureID(ImTextureID texture_id);
|
IMGUI_API void PushTextureID(ImTextureID texture_id);
|
||||||
IMGUI_API void PopTextureID();
|
IMGUI_API void PopTextureID();
|
||||||
inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); }
|
ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); }
|
||||||
inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
|
ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
|
||||||
|
|
||||||
// Primitives
|
// Primitives
|
||||||
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
||||||
@@ -1959,11 +1959,11 @@ struct ImDrawList
|
|||||||
IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
|
IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
|
||||||
|
|
||||||
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
||||||
inline void PathClear() { _Path.Size = 0; }
|
void PathClear() { _Path.Size = 0; }
|
||||||
inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
|
void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
|
||||||
inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size-1], &pos, 8) != 0) _Path.push_back(pos); }
|
void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size-1], &pos, 8) != 0) _Path.push_back(pos); }
|
||||||
inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } // Note: Anti-aliased filling requires points to be in clockwise order.
|
void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } // Note: Anti-aliased filling requires points to be in clockwise order.
|
||||||
inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; }
|
void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; }
|
||||||
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10);
|
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10);
|
||||||
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
|
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
|
||||||
IMGUI_API void PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0);
|
IMGUI_API void PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0);
|
||||||
@@ -1977,9 +1977,9 @@ struct ImDrawList
|
|||||||
// Advanced: Channels
|
// Advanced: Channels
|
||||||
// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
|
// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
|
||||||
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
|
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
|
||||||
inline void ChannelsSplit(int count) { _Splitter.Split(this, count); }
|
void ChannelsSplit(int count) { _Splitter.Split(this, count); }
|
||||||
inline void ChannelsMerge() { _Splitter.Merge(this); }
|
void ChannelsMerge() { _Splitter.Merge(this); }
|
||||||
inline void ChannelsSetCurrent(int n) { _Splitter.SetCurrentChannel(this, n); }
|
void ChannelsSetCurrent(int n) { _Splitter.SetCurrentChannel(this, n); }
|
||||||
|
|
||||||
// Internal helpers
|
// Internal helpers
|
||||||
// NB: all primitives needs to be reserved via PrimReserve() beforehand!
|
// NB: all primitives needs to be reserved via PrimReserve() beforehand!
|
||||||
@@ -1989,9 +1989,9 @@ struct ImDrawList
|
|||||||
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles)
|
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles)
|
||||||
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
|
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
|
||||||
IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
|
IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
|
||||||
inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
|
void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
|
||||||
inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
|
void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
|
||||||
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); }
|
void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); }
|
||||||
IMGUI_API void UpdateClipRect();
|
IMGUI_API void UpdateClipRect();
|
||||||
IMGUI_API void UpdateTextureID();
|
IMGUI_API void UpdateTextureID();
|
||||||
};
|
};
|
||||||
@@ -2064,15 +2064,15 @@ struct ImFontGlyphRangesBuilder
|
|||||||
ImVector<ImU32> UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used)
|
ImVector<ImU32> UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used)
|
||||||
|
|
||||||
ImFontGlyphRangesBuilder() { Clear(); }
|
ImFontGlyphRangesBuilder() { Clear(); }
|
||||||
inline void Clear() {
|
void Clear() {
|
||||||
const int size_in_bytes = 0x10000 / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
|
const int size_in_bytes = 0x10000 / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
|
||||||
inline bool GetBit(int n) const {
|
bool GetBit(int n) const {
|
||||||
const int off = (n >> 5);
|
const int off = (n >> 5);
|
||||||
const ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; } // Get bit n in the array
|
const ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; } // Get bit n in the array
|
||||||
inline void SetBit(int n) {
|
void SetBit(int n) {
|
||||||
const int off = (n >> 5);
|
const int off = (n >> 5);
|
||||||
const ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; } // Set bit n in the array
|
const ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; } // Set bit n in the array
|
||||||
inline void AddChar(ImWchar c) { SetBit(c); } // Add character
|
void AddChar(ImWchar c) { SetBit(c); } // Add character
|
||||||
IMGUI_API void AddText(const char* text, const char* text_end = NULL); // Add string (each character of the UTF-8 string are added)
|
IMGUI_API void AddText(const char* text, const char* text_end = NULL); // Add string (each character of the UTF-8 string are added)
|
||||||
IMGUI_API void AddRanges(const ImWchar* ranges); // Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault()) to force add all of ASCII/Latin+Ext
|
IMGUI_API void AddRanges(const ImWchar* ranges); // Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault()) to force add all of ASCII/Latin+Ext
|
||||||
IMGUI_API void BuildRanges(ImVector<ImWchar>* out_ranges); // Output new ranges
|
IMGUI_API void BuildRanges(ImVector<ImWchar>* out_ranges); // Output new ranges
|
||||||
|
|||||||
@@ -815,7 +815,7 @@ struct ImGuiNextWindowData
|
|||||||
ImVec2 MenuBarOffsetMinVal; // *Always on* This is not exposed publicly, so we don't clear it.
|
ImVec2 MenuBarOffsetMinVal; // *Always on* This is not exposed publicly, so we don't clear it.
|
||||||
|
|
||||||
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
|
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
|
||||||
inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
|
void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ImGuiNextItemDataFlags_
|
enum ImGuiNextItemDataFlags_
|
||||||
@@ -833,7 +833,7 @@ struct ImGuiNextItemData
|
|||||||
ImGuiCond OpenCond;
|
ImGuiCond OpenCond;
|
||||||
|
|
||||||
ImGuiNextItemData() { memset(this, 0, sizeof(*this)); }
|
ImGuiNextItemData() { memset(this, 0, sizeof(*this)); }
|
||||||
inline void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; }
|
void ClearFlags() { Flags = ImGuiNextItemDataFlags_None; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -460,16 +460,16 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// posts specified command for specified recipient into m_intercept_queue
|
// posts specified command for specified recipient into m_intercept_queue
|
||||||
void
|
void
|
||||||
push( command_data const &Command, uint32_t const Recipient );
|
push( command_data const &Command, uint32_t Recipient );
|
||||||
// retrieves oldest posted command for specified recipient, if any. returns: true on retrieval, false if there's nothing to retrieve
|
// retrieves oldest posted command for specified recipient, if any. returns: true on retrieval, false if there's nothing to retrieve
|
||||||
bool
|
bool
|
||||||
pop( command_data &Command, uint32_t const Recipient );
|
pop( command_data &Command, uint32_t Recipient );
|
||||||
// generates active continuous commands
|
// generates active continuous commands
|
||||||
void
|
void
|
||||||
update();
|
update();
|
||||||
// checks if given command must be scheduled on server
|
// checks if given command must be scheduled on server
|
||||||
bool
|
bool
|
||||||
is_network_target(const uint32_t Recipient);
|
is_network_target(uint32_t Recipient);
|
||||||
|
|
||||||
// pops commands from intercept queue
|
// pops commands from intercept queue
|
||||||
commands_map pop_intercept_queue();
|
commands_map pop_intercept_queue();
|
||||||
@@ -485,7 +485,7 @@ private:
|
|||||||
// contains intercepted commands to be read by application layer
|
// contains intercepted commands to be read by application layer
|
||||||
commands_map m_intercept_queue;
|
commands_map m_intercept_queue;
|
||||||
|
|
||||||
void push_direct( command_data const &Command, uint32_t const Recipient );
|
void push_direct( command_data const &Command, uint32_t Recipient );
|
||||||
|
|
||||||
// hash operator for m_active_continuous
|
// hash operator for m_active_continuous
|
||||||
struct command_set_hash {
|
struct command_set_hash {
|
||||||
@@ -528,8 +528,8 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// posts specified command for the specified recipient
|
// posts specified command for the specified recipient
|
||||||
void
|
void
|
||||||
post(user_command const Command, double const Param1, double const Param2,
|
post(user_command Command, double Param1, double Param2,
|
||||||
int const Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr) const;
|
int Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr) const;
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ public:
|
|||||||
void
|
void
|
||||||
release();
|
release();
|
||||||
void
|
void
|
||||||
on_move( double const Mousex, double const Mousey );
|
on_move( double Mousex, double Mousey );
|
||||||
inline
|
user_command
|
||||||
user_command
|
|
||||||
command() const {
|
command() const {
|
||||||
return m_command; }
|
return m_command; }
|
||||||
double
|
double
|
||||||
@@ -55,13 +54,13 @@ public:
|
|||||||
bool
|
bool
|
||||||
recall_bindings();
|
recall_bindings();
|
||||||
void
|
void
|
||||||
button( int const Button, int const Action );
|
button( int Button, int Action );
|
||||||
int
|
int
|
||||||
button( int const Button ) const;
|
button( int Button ) const;
|
||||||
void
|
void
|
||||||
move( double const Horizontal, double const Vertical );
|
move( double Horizontal, double Vertical );
|
||||||
void
|
void
|
||||||
scroll( double const Xoffset, double const Yoffset );
|
scroll( double Xoffset, double Yoffset );
|
||||||
void
|
void
|
||||||
poll();
|
poll();
|
||||||
user_command
|
user_command
|
||||||
|
|||||||
@@ -21,15 +21,13 @@ public:
|
|||||||
bool
|
bool
|
||||||
init();
|
init();
|
||||||
void
|
void
|
||||||
position( double const Horizontal, double const Vertical );
|
position( double Horizontal, double Vertical );
|
||||||
inline
|
glm::dvec2
|
||||||
glm::dvec2
|
|
||||||
position() const {
|
position() const {
|
||||||
return m_cursorposition; }
|
return m_cursorposition; }
|
||||||
void
|
void
|
||||||
button( int const Button, int const Action );
|
button( int Button, int Action );
|
||||||
inline
|
int
|
||||||
int
|
|
||||||
button( int const Button ) const {
|
button( int const Button ) const {
|
||||||
return m_buttons[ Button ]; }
|
return m_buttons[ Button ]; }
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ private:
|
|||||||
using inputaxis_sequence = std::vector<input_axis>;
|
using inputaxis_sequence = std::vector<input_axis>;
|
||||||
// methods
|
// methods
|
||||||
bool recall_bindings();
|
bool recall_bindings();
|
||||||
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point );
|
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string Point );
|
||||||
void on_button( int const Button, int const Action );
|
void on_button( int Button, int Action );
|
||||||
void process_axes();
|
void process_axes();
|
||||||
|
|
||||||
// members
|
// members
|
||||||
|
|||||||
@@ -50,22 +50,21 @@ public:
|
|||||||
bool
|
bool
|
||||||
init() { return true; }
|
init() { return true; }
|
||||||
bool
|
bool
|
||||||
key( int const Key, int const Action );
|
key( int Key, int Action );
|
||||||
int
|
int
|
||||||
key( int const Key ) const;
|
key( int Key ) const;
|
||||||
void
|
void
|
||||||
poll();
|
poll();
|
||||||
inline
|
user_command const
|
||||||
user_command const
|
|
||||||
command() const {
|
command() const {
|
||||||
return m_command; }
|
return m_command; }
|
||||||
bindingsetup_sequence&
|
bindingsetup_sequence&
|
||||||
bindings() {
|
bindings() {
|
||||||
return m_bindingsetups; }
|
return m_bindingsetups; }
|
||||||
int
|
int
|
||||||
binding( user_command const Command ) const;
|
binding( user_command Command ) const;
|
||||||
std::string
|
std::string
|
||||||
binding_hint( user_command const Command ) const;
|
binding_hint( user_command Command ) const;
|
||||||
void
|
void
|
||||||
dump_bindings();
|
dump_bindings();
|
||||||
|
|
||||||
@@ -101,7 +100,7 @@ private:
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
bool
|
bool
|
||||||
is_movement_key( int const Key ) const;
|
is_movement_key( int Key ) const;
|
||||||
|
|
||||||
// members
|
// members
|
||||||
user_command m_command { user_command::none }; // last, if any, issued command
|
user_command m_command { user_command::none }; // last, if any, issued command
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ class TAnimContainer : std::enable_shared_from_this<TAnimContainer>
|
|||||||
// wyświetlania
|
// wyświetlania
|
||||||
TAnimContainer();
|
TAnimContainer();
|
||||||
bool Init(TSubModel *pNewSubModel);
|
bool Init(TSubModel *pNewSubModel);
|
||||||
inline
|
std::string NameGet() {
|
||||||
std::string NameGet() {
|
|
||||||
return pSubModel ? pSubModel->pName : ""; };
|
return pSubModel ? pSubModel->pName : ""; };
|
||||||
void SetRotateAnim( glm::vec3 vNewRotateAngles, double fNewRotateSpeed);
|
void SetRotateAnim( glm::vec3 vNewRotateAngles, double fNewRotateSpeed);
|
||||||
void SetTranslateAnim( glm::dvec3 vNewTranslate, double fNewSpeed);
|
void SetTranslateAnim( glm::dvec3 vNewTranslate, double fNewSpeed);
|
||||||
@@ -88,19 +87,15 @@ class TAnimContainer : std::enable_shared_from_this<TAnimContainer>
|
|||||||
void UpdateModel();
|
void UpdateModel();
|
||||||
void UpdateModelIK();
|
void UpdateModelIK();
|
||||||
bool InMovement(); // czy w trakcie animacji?
|
bool InMovement(); // czy w trakcie animacji?
|
||||||
inline
|
double AngleGet() {
|
||||||
double AngleGet() {
|
|
||||||
return vRotateAngles.z; }; // jednak ostatnia, T3D ma inny układ
|
return vRotateAngles.z; }; // jednak ostatnia, T3D ma inny układ
|
||||||
inline
|
glm::dvec3 TransGet() {
|
||||||
glm::dvec3 TransGet() {
|
|
||||||
return glm::dvec3(-vTranslation.x, vTranslation.z, vTranslation.y); }; // zmiana, bo T3D ma inny układ
|
return glm::dvec3(-vTranslation.x, vTranslation.z, vTranslation.y); }; // zmiana, bo T3D ma inny układ
|
||||||
inline
|
void WillBeAnimated() {
|
||||||
void WillBeAnimated() {
|
|
||||||
if (pSubModel)
|
if (pSubModel)
|
||||||
pSubModel->WillBeAnimated(); };
|
pSubModel->WillBeAnimated(); };
|
||||||
void EventAssign(basic_event *ev);
|
void EventAssign(basic_event *ev);
|
||||||
inline
|
basic_event * Event() {
|
||||||
basic_event * Event() {
|
|
||||||
return evDone; };
|
return evDone; };
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -120,27 +115,23 @@ public:
|
|||||||
bool Load(cParser *parser, bool ter = false);
|
bool Load(cParser *parser, bool ter = false);
|
||||||
std::shared_ptr<TAnimContainer> AddContainer(std::string const &Name);
|
std::shared_ptr<TAnimContainer> AddContainer(std::string const &Name);
|
||||||
std::shared_ptr<TAnimContainer> GetContainer(std::string const &Name = "");
|
std::shared_ptr<TAnimContainer> GetContainer(std::string const &Name = "");
|
||||||
void LightSet( int const n, float const v );
|
void LightSet( int n, float v );
|
||||||
void SkinSet( int const Index, material_handle const Material );
|
void SkinSet( int Index, material_handle Material );
|
||||||
std::optional<std::tuple<float, float, std::optional<glm::vec3> > > LightGet( int const n );
|
std::optional<std::tuple<float, float, std::optional<glm::vec3> > > LightGet( int n );
|
||||||
int TerrainCount();
|
int TerrainCount();
|
||||||
TSubModel * TerrainSquare(int n);
|
TSubModel * TerrainSquare(int n);
|
||||||
int Flags();
|
int Flags();
|
||||||
void on_season_update();
|
void on_season_update();
|
||||||
inline
|
material_data const *
|
||||||
material_data const *
|
|
||||||
Material() const {
|
Material() const {
|
||||||
return &m_materialdata; }
|
return &m_materialdata; }
|
||||||
inline
|
TModel3d *
|
||||||
TModel3d *
|
|
||||||
Model() const {
|
Model() const {
|
||||||
return pModel; }
|
return pModel; }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
Angles( glm::vec3 const &Angles ) {
|
Angles( glm::vec3 const &Angles ) {
|
||||||
vAngle = Angles; }
|
vAngle = Angles; }
|
||||||
inline
|
glm::vec3
|
||||||
glm::vec3
|
|
||||||
Angles() const {
|
Angles() const {
|
||||||
return vAngle; }
|
return vAngle; }
|
||||||
// per-axis scale, applied between rotation and the submodel-local transform chain.
|
// per-axis scale, applied between rotation and the submodel-local transform chain.
|
||||||
@@ -148,19 +139,16 @@ public:
|
|||||||
// optional `scale <factor>` / `scale <x> <y> <z>` token inside a `node model` block.
|
// optional `scale <factor>` / `scale <x> <y> <z>` token inside a `node model` block.
|
||||||
// Per-axis values let you stretch a model along a single dimension; uniform input
|
// Per-axis values let you stretch a model along a single dimension; uniform input
|
||||||
// (single float) broadcasts to all three axes.
|
// (single float) broadcasts to all three axes.
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
Scale( glm::vec3 const &Factor ) {
|
Scale( glm::vec3 const &Factor ) {
|
||||||
m_scale = glm::vec3(
|
m_scale = glm::vec3(
|
||||||
Factor.x > 0.0f ? Factor.x : 1.0f,
|
Factor.x > 0.0f ? Factor.x : 1.0f,
|
||||||
Factor.y > 0.0f ? Factor.y : 1.0f,
|
Factor.y > 0.0f ? Factor.y : 1.0f,
|
||||||
Factor.z > 0.0f ? Factor.z : 1.0f ); }
|
Factor.z > 0.0f ? Factor.z : 1.0f ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
Scale( float const Factor ) {
|
Scale( float const Factor ) {
|
||||||
Scale( glm::vec3( Factor ) ); }
|
Scale( glm::vec3( Factor ) ); }
|
||||||
inline
|
glm::vec3 const &
|
||||||
glm::vec3 const &
|
|
||||||
Scale() const {
|
Scale() const {
|
||||||
return m_scale; }
|
return m_scale; }
|
||||||
// members
|
// members
|
||||||
@@ -172,7 +160,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void RaPrepare(); // ustawienie animacji egzemplarza na wzorcu
|
void RaPrepare(); // ustawienie animacji egzemplarza na wzorcu
|
||||||
void RaAnimate( unsigned int const Framestamp ); // przeliczenie animacji egzemplarza
|
void RaAnimate( unsigned int Framestamp ); // przeliczenie animacji egzemplarza
|
||||||
|
|
||||||
// radius() subclass details, calculates node's bounding radius
|
// radius() subclass details, calculates node's bounding radius
|
||||||
float radius_();
|
float radius_();
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
class TMdlContainer {
|
class TMdlContainer {
|
||||||
friend class TModelsManager;
|
friend class TModelsManager;
|
||||||
private:
|
private:
|
||||||
TModel3d *LoadModel( std::string const &Name, bool const Dynamic );
|
TModel3d *LoadModel( std::string const &Name, bool Dynamic );
|
||||||
std::shared_ptr<TModel3d> Model { nullptr };
|
std::shared_ptr<TModel3d> Model { nullptr };
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
};
|
};
|
||||||
@@ -22,7 +22,7 @@ private:
|
|||||||
class TModelsManager {
|
class TModelsManager {
|
||||||
public:
|
public:
|
||||||
// McZapkie: dodalem sciezke, notabene Path!=Patch :)
|
// McZapkie: dodalem sciezke, notabene Path!=Patch :)
|
||||||
static TModel3d *GetModel(std::string const &Name, bool const dynamic = false, bool const Logerrors = true , int uid = 0);
|
static TModel3d *GetModel(std::string const &Name, bool dynamic = false, bool Logerrors = true , int uid = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types:
|
// types:
|
||||||
@@ -32,7 +32,7 @@ private:
|
|||||||
static modelcontainer_sequence m_models;
|
static modelcontainer_sequence m_models;
|
||||||
static stringmodelcontainerindex_map m_modelsmap;
|
static stringmodelcontainerindex_map m_modelsmap;
|
||||||
// methods:
|
// methods:
|
||||||
static TModel3d *LoadModel(std::string const &Name, const std::string &virtualName, bool const Dynamic );
|
static TModel3d *LoadModel(std::string const &Name, const std::string &virtualName, bool Dynamic );
|
||||||
static std::pair<bool, TModel3d *> find_in_databank( std::string const &Name );
|
static std::pair<bool, TModel3d *> find_in_databank( std::string const &Name );
|
||||||
// checks whether specified file exists. returns name of the located file, or empty string.
|
// checks whether specified file exists. returns name of the located file, or empty string.
|
||||||
static std::string find_on_disk( std::string const &Name );
|
static std::string find_on_disk( std::string const &Name );
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public: // chwilowo
|
|||||||
std::string m_materialname; // robocza nazwa tekstury do zapisania w pliku binarnym
|
std::string m_materialname; // robocza nazwa tekstury do zapisania w pliku binarnym
|
||||||
std::string pName; // robocza nazwa
|
std::string pName; // robocza nazwa
|
||||||
public:
|
public:
|
||||||
int SeekFaceNormal( std::vector<unsigned int> const &Masks, int const Startface, unsigned int const Mask, glm::vec3 const &Position, gfx::vertex_array const &Vertices );
|
int SeekFaceNormal( std::vector<unsigned int> const &Masks, int Startface, unsigned int Mask, glm::vec3 const &Position, gfx::vertex_array const &Vertices );
|
||||||
void RaAnimation(TAnimType a);
|
void RaAnimation(TAnimType a);
|
||||||
void RaAnimation(glm::mat4 &m, TAnimType a);
|
void RaAnimation(glm::mat4 &m, TAnimType a);
|
||||||
// returns true if the submodel is a smoke emitter attachment point, false otherwise
|
// returns true if the submodel is a smoke emitter attachment point, false otherwise
|
||||||
@@ -196,11 +196,11 @@ public:
|
|||||||
void SetTranslate(float3 vNewTransVector);
|
void SetTranslate(float3 vNewTransVector);
|
||||||
void SetRotateIK1(float3 vNewAngles);
|
void SetRotateIK1(float3 vNewAngles);
|
||||||
TSubModel * GetFromName( std::string const &search, bool i = true );
|
TSubModel * GetFromName( std::string const &search, bool i = true );
|
||||||
inline float4x4 * GetMatrix() { return fMatrix; };
|
float4x4 * GetMatrix() { return fMatrix; };
|
||||||
inline float4x4 const * GetMatrix() const { return fMatrix; };
|
float4x4 const * GetMatrix() const { return fMatrix; };
|
||||||
// returns offset vector from root
|
// returns offset vector from root
|
||||||
glm::vec3 offset( float const Geometrytestoffsetthreshold = 0.f ) const;
|
glm::vec3 offset( float Geometrytestoffsetthreshold = 0.f ) const;
|
||||||
inline void Hide() { iVisible = 0; };
|
void Hide() { iVisible = 0; };
|
||||||
|
|
||||||
void create_geometry( std::size_t &Indexoffset, std::size_t &Vertexoffset, gfx::geometrybank_handle const &Bank );
|
void create_geometry( std::size_t &Indexoffset, std::size_t &Vertexoffset, gfx::geometrybank_handle const &Bank );
|
||||||
uint32_t FlagsCheck();
|
uint32_t FlagsCheck();
|
||||||
@@ -218,18 +218,18 @@ public:
|
|||||||
void UnFlagNext() { iFlags &= 0x00FFFFFF; };
|
void UnFlagNext() { iFlags &= 0x00FFFFFF; };
|
||||||
void ColorsSet( glm::vec3 const &Ambient, glm::vec3 const &Diffuse, glm::vec3 const &Specular );
|
void ColorsSet( glm::vec3 const &Ambient, glm::vec3 const &Diffuse, glm::vec3 const &Specular );
|
||||||
// sets rgb components of diffuse color override to specified value
|
// sets rgb components of diffuse color override to specified value
|
||||||
void SetDiffuseOverride( glm::vec3 const &Color, bool const Includechildren = false, bool const Includesiblings = false );
|
void SetDiffuseOverride( glm::vec3 const &Color, bool Includechildren = false, bool Includesiblings = false );
|
||||||
// gets rgb components of any freespot diffuse color (searches also in children)
|
// gets rgb components of any freespot diffuse color (searches also in children)
|
||||||
std::optional<glm::vec3> GetDiffuse( float Includesiblings = false );
|
std::optional<glm::vec3> GetDiffuse( float Includesiblings = false );
|
||||||
// sets visibility level (alpha component) to specified value
|
// sets visibility level (alpha component) to specified value
|
||||||
void SetVisibilityLevel( float const Level, bool const Includechildren = false, bool const Includesiblings = false );
|
void SetVisibilityLevel( float Level, bool Includechildren = false, bool Includesiblings = false );
|
||||||
// sets light level (alpha component of illumination color) to specified value
|
// sets light level (alpha component of illumination color) to specified value
|
||||||
void SetLightLevel( glm::vec4 const &Level, bool const Includechildren = false, bool const Includesiblings = false );
|
void SetLightLevel( glm::vec4 const &Level, bool Includechildren = false, bool Includesiblings = false );
|
||||||
// sets activation threshold of self-illumination to specitied value
|
// sets activation threshold of self-illumination to specitied value
|
||||||
void SetSelfIllum( float const Threshold, bool const Includechildren = false, bool const Includesiblings = false );
|
void SetSelfIllum( float Threshold, bool Includechildren = false, bool Includesiblings = false );
|
||||||
inline float3 Translation1Get() {
|
float3 Translation1Get() {
|
||||||
return fMatrix ? *fMatrix->TranslationGet() + v_TransVector : v_TransVector; }
|
return fMatrix ? *fMatrix->TranslationGet() + v_TransVector : v_TransVector; }
|
||||||
inline float3 Translation2Get() {
|
float3 Translation2Get() {
|
||||||
return *fMatrix->TranslationGet() + Child->Translation1Get(); }
|
return *fMatrix->TranslationGet() + Child->Translation1Get(); }
|
||||||
material_handle GetMaterial() const {
|
material_handle GetMaterial() const {
|
||||||
return m_material; }
|
return m_material; }
|
||||||
@@ -247,9 +247,9 @@ public:
|
|||||||
std::vector<std::string>&,
|
std::vector<std::string>&,
|
||||||
std::vector<std::string>&,
|
std::vector<std::string>&,
|
||||||
std::vector<float4x4>&);
|
std::vector<float4x4>&);
|
||||||
void serialize_geometry( std::ostream &Output, bool const Packed, bool const Indexed, bool const UserData ) const;
|
void serialize_geometry( std::ostream &Output, bool Packed, bool Indexed, bool UserData ) const;
|
||||||
int index_size() const;
|
int index_size() const;
|
||||||
void serialize_indices( std::ostream &Output, int const Size ) const;
|
void serialize_indices( std::ostream &Output, int Size ) const;
|
||||||
// places contained geometry in provided ground node
|
// places contained geometry in provided ground node
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ public:
|
|||||||
~TModel3d();
|
~TModel3d();
|
||||||
float bounding_radius() const {
|
float bounding_radius() const {
|
||||||
return Root ? Root->m_boundingradius : 0.f; }
|
return Root ? Root->m_boundingradius : 0.f; }
|
||||||
inline TSubModel * GetSMRoot() { return Root; };
|
TSubModel * GetSMRoot() { return Root; };
|
||||||
TSubModel * GetFromName(std::string const &Name) const;
|
TSubModel * GetFromName(std::string const &Name) const;
|
||||||
TSubModel * AddToNamed(const char *Name, TSubModel *SubModel);
|
TSubModel * AddToNamed(const char *Name, TSubModel *SubModel);
|
||||||
nameoffset_sequence const & find_smoke_sources();
|
nameoffset_sequence const & find_smoke_sources();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct opengl_texture : public ITexture {
|
|||||||
static void
|
static void
|
||||||
unbind( size_t unit );
|
unbind( size_t unit );
|
||||||
virtual bool
|
virtual bool
|
||||||
create( bool const Static = false ) override;
|
create( bool Static = false ) override;
|
||||||
// releases resources allocated on the opengl end, storing local copy if requested
|
// releases resources allocated on the opengl end, storing local copy if requested
|
||||||
void
|
void
|
||||||
release() override;
|
release() override;
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
void load_STBI();
|
void load_STBI();
|
||||||
void load_TGA();
|
void load_TGA();
|
||||||
void set_filtering() const;
|
void set_filtering() const;
|
||||||
void downsize( GLuint const Format );
|
void downsize( GLuint Format );
|
||||||
void flip_vertical();
|
void flip_vertical();
|
||||||
void gles_match_internalformat(GLuint format);
|
void gles_match_internalformat(GLuint format);
|
||||||
|
|
||||||
@@ -144,15 +144,15 @@ public:
|
|||||||
|
|
||||||
// activates specified texture unit
|
// activates specified texture unit
|
||||||
void
|
void
|
||||||
unit( GLint const Textureunit );
|
unit( GLint Textureunit );
|
||||||
// creates texture object out of data stored in specified file
|
// creates texture object out of data stored in specified file
|
||||||
texture_handle
|
texture_handle
|
||||||
create( std::string Filename, bool const Loadnow = true, GLint Formathint = GL_SRGB_ALPHA );
|
create( std::string Filename, bool Loadnow = true, GLint Formathint = GL_SRGB_ALPHA );
|
||||||
// binds specified texture to specified texture unit
|
// binds specified texture to specified texture unit
|
||||||
void
|
void
|
||||||
bind( std::size_t const Unit, texture_handle const Texture );
|
bind( std::size_t Unit, texture_handle Texture );
|
||||||
opengl_texture &
|
opengl_texture &
|
||||||
mark_as_used( texture_handle const Texture );
|
mark_as_used( texture_handle Texture );
|
||||||
// provides direct access to specified texture object
|
// provides direct access to specified texture object
|
||||||
opengl_texture &
|
opengl_texture &
|
||||||
texture( texture_handle const Texture ) const { return *m_textures[Texture].first; }
|
texture( texture_handle const Texture ) const { return *m_textures[Texture].first; }
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ struct opengl_material : public IMaterial {
|
|||||||
opengl_material();
|
opengl_material();
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
bool deserialize(cParser &Input, bool const Loadnow);
|
bool deserialize(cParser &Input, bool Loadnow);
|
||||||
virtual void finalize(bool Loadnow) override;
|
virtual void finalize(bool Loadnow) override;
|
||||||
virtual bool update() override;
|
virtual bool update() override;
|
||||||
virtual float get_or_guess_opacity() const override;
|
virtual float get_or_guess_opacity() const override;
|
||||||
@@ -74,7 +74,7 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
// imports member data pair from the config file
|
// imports member data pair from the config file
|
||||||
bool
|
bool
|
||||||
deserialize_mapping( cParser &Input, int const Priority, bool const Loadnow );
|
deserialize_mapping( cParser &Input, int Priority, bool Loadnow );
|
||||||
void log_error(const std::string &str);
|
void log_error(const std::string &str);
|
||||||
|
|
||||||
// members
|
// members
|
||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
material_manager() { m_materials.emplace_back( opengl_material() ); } // empty bindings for null material
|
material_manager() { m_materials.emplace_back( opengl_material() ); } // empty bindings for null material
|
||||||
|
|
||||||
material_handle
|
material_handle
|
||||||
create( std::string const &Filename, bool const Loadnow );
|
create( std::string const &Filename, bool Loadnow );
|
||||||
opengl_material const &
|
opengl_material const &
|
||||||
material( material_handle const Material ) const { return m_materials[ Material ]; }
|
material( material_handle const Material ) const { return m_materials[ Material ]; }
|
||||||
opengl_material &
|
opengl_material &
|
||||||
|
|||||||
@@ -40,35 +40,28 @@ public:
|
|||||||
void
|
void
|
||||||
calculate(glm::mat4 const &Projection, glm::mat4 const &Modelview);
|
calculate(glm::mat4 const &Projection, glm::mat4 const &Modelview);
|
||||||
// returns true if specified point is inside of the frustum
|
// returns true if specified point is inside of the frustum
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
point_inside( glm::vec3 const &Point ) const { return point_inside( Point.x, Point.y, Point.z ); }
|
point_inside( glm::vec3 const &Point ) const { return point_inside( Point.x, Point.y, Point.z ); }
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
point_inside( float3 const &Point ) const { return point_inside( Point.x, Point.y, Point.z ); }
|
point_inside( float3 const &Point ) const { return point_inside( Point.x, Point.y, Point.z ); }
|
||||||
bool
|
bool
|
||||||
point_inside( float const X, float const Y, float const Z ) const;
|
point_inside( float X, float Y, float Z ) const;
|
||||||
// tests if the sphere is in frustum, returns the distance between origin and sphere centre
|
// tests if the sphere is in frustum, returns the distance between origin and sphere centre
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
sphere_inside( glm::dvec3 const &Center, float const Radius ) const { return sphere_inside( static_cast<float>( Center.x ), static_cast<float>( Center.y ), static_cast<float>( Center.z ), Radius ); }
|
sphere_inside( glm::dvec3 const &Center, float const Radius ) const { return sphere_inside( static_cast<float>( Center.x ), static_cast<float>( Center.y ), static_cast<float>( Center.z ), Radius ); }
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
sphere_inside( glm::vec3 const &Center, float const Radius ) const { return sphere_inside( Center.x, Center.y, Center.z, Radius ); }
|
sphere_inside( glm::vec3 const &Center, float const Radius ) const { return sphere_inside( Center.x, Center.y, Center.z, Radius ); }
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
sphere_inside( float3 const &Center, float const Radius ) const { return sphere_inside( Center.x, Center.y, Center.z, Radius ); }
|
sphere_inside( float3 const &Center, float const Radius ) const { return sphere_inside( Center.x, Center.y, Center.z, Radius ); }
|
||||||
float
|
float
|
||||||
sphere_inside( float const X, float const Y, float const Z, float const Radius ) const;
|
sphere_inside( float X, float Y, float Z, float Radius ) const;
|
||||||
// returns true if specified cube is inside of the frustum. Size = half of the length
|
// returns true if specified cube is inside of the frustum. Size = half of the length
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
cube_inside( glm::vec3 const &Center, float const Size ) const { return cube_inside( Center.x, Center.y, Center.z, Size ); }
|
cube_inside( glm::vec3 const &Center, float const Size ) const { return cube_inside( Center.x, Center.y, Center.z, Size ); }
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
cube_inside( float3 const &Center, float const Size ) const { return cube_inside( Center.x, Center.y, Center.z, Size ); }
|
cube_inside( float3 const &Center, float const Size ) const { return cube_inside( Center.x, Center.y, Center.z, Size ); }
|
||||||
bool
|
bool
|
||||||
cube_inside( float const X, float const Y, float const Z, float const Size ) const;
|
cube_inside( float X, float Y, float Z, float Size ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types:
|
// types:
|
||||||
@@ -79,7 +72,7 @@ private:
|
|||||||
|
|
||||||
// methods:
|
// methods:
|
||||||
void
|
void
|
||||||
normalize_plane( side const Side ); // normalizes a plane (A side) from the frustum
|
normalize_plane( side Side ); // normalizes a plane (A side) from the frustum
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
float m_frustum[6][4]; // holds the A B C and D values (normal & distance) for each side of the frustum.
|
float m_frustum[6][4]; // holds the A B C and D values (normal & distance) for each side of the frustum.
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ struct basic_vertex {
|
|||||||
{}
|
{}
|
||||||
static basic_vertex convert(world_vertex const &world, glm::dvec3 const &origin);
|
static basic_vertex convert(world_vertex const &world, glm::dvec3 const &origin);
|
||||||
world_vertex to_world(glm::dvec3 const &origin = glm::dvec3(0.)) const;
|
world_vertex to_world(glm::dvec3 const &origin = glm::dvec3(0.)) const;
|
||||||
void serialize( std::ostream&, bool const Tangent = false ) const;
|
void serialize( std::ostream&, bool Tangent = false ) const;
|
||||||
void deserialize( std::istream&, bool const Tangent = false );
|
void deserialize( std::istream&, bool Tangent = false );
|
||||||
void serialize_packed( std::ostream&, bool const Tangent = false ) const;
|
void serialize_packed( std::ostream&, bool Tangent = false ) const;
|
||||||
void deserialize_packed( std::istream&, bool const Tangent = false );
|
void deserialize_packed( std::istream&, bool Tangent = false );
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vertex_userdata{
|
struct vertex_userdata{
|
||||||
@@ -65,7 +65,7 @@ using vertex_array = std::vector<basic_vertex>;
|
|||||||
using userdata_array = std::vector<vertex_userdata>;
|
using userdata_array = std::vector<vertex_userdata>;
|
||||||
using index_array = std::vector<basic_index>;
|
using index_array = std::vector<basic_index>;
|
||||||
|
|
||||||
void calculate_tangents( vertex_array &vertices, index_array const &indices, int const type );
|
void calculate_tangents( vertex_array &vertices, index_array const &indices, int type );
|
||||||
void calculate_indices( index_array &Indices, vertex_array &Vertices, userdata_array &Userdata, float tolerancescale = 1.0f );
|
void calculate_indices( index_array &Indices, vertex_array &Vertices, userdata_array &Userdata, float tolerancescale = 1.0f );
|
||||||
|
|
||||||
// generic geometry bank class, allows storage, update and drawing of geometry chunks
|
// generic geometry bank class, allows storage, update and drawing of geometry chunks
|
||||||
@@ -79,8 +79,8 @@ struct geometry_handle {
|
|||||||
bank( Bank ), chunk( Chunk )
|
bank( Bank ), chunk( Chunk )
|
||||||
{}
|
{}
|
||||||
// methods
|
// methods
|
||||||
inline
|
|
||||||
operator std::uint64_t() const {
|
operator std::uint64_t() const {
|
||||||
/*
|
/*
|
||||||
return bank << 14 | chunk; }
|
return bank << 14 | chunk; }
|
||||||
*/
|
*/
|
||||||
@@ -110,17 +110,17 @@ public:
|
|||||||
|
|
||||||
// methods:
|
// methods:
|
||||||
// creates a new geometry chunk of specified type from supplied data. returns: handle to the chunk or NULL
|
// creates a new geometry chunk of specified type from supplied data. returns: handle to the chunk or NULL
|
||||||
auto create( vertex_array &Vertices, userdata_array& Userdata, unsigned int const Type ) -> geometry_handle;
|
auto create( vertex_array &Vertices, userdata_array& Userdata, unsigned int Type ) -> geometry_handle;
|
||||||
// creates a new indexed geometry chunk of specified type from supplied data. returns: handle to the chunk or NULL
|
// creates a new indexed geometry chunk of specified type from supplied data. returns: handle to the chunk or NULL
|
||||||
auto create( index_array &Indices, vertex_array &Vertices, userdata_array& Userdata, unsigned int const Type ) -> geometry_handle;
|
auto create( index_array &Indices, vertex_array &Vertices, userdata_array& Userdata, unsigned int Type ) -> geometry_handle;
|
||||||
// replaces vertex data of specified chunk with the supplied data, starting from specified offset
|
// replaces vertex data of specified chunk with the supplied data, starting from specified offset
|
||||||
auto replace( vertex_array &Vertices, userdata_array& Userdata, geometry_handle const &Geometry, std::size_t const Offset = 0 ) -> bool;
|
auto replace( vertex_array &Vertices, userdata_array& Userdata, geometry_handle const &Geometry, std::size_t Offset = 0 ) -> bool;
|
||||||
// adds supplied vertex data at the end of specified chunk
|
// adds supplied vertex data at the end of specified chunk
|
||||||
auto append( vertex_array &Vertices, userdata_array& Userdata, geometry_handle const &Geometry ) -> bool;
|
auto append( vertex_array &Vertices, userdata_array& Userdata, geometry_handle const &Geometry ) -> bool;
|
||||||
// draws geometry stored in specified chunk
|
// draws geometry stored in specified chunk
|
||||||
auto draw( geometry_handle const &Geometry, stream_units const &Units, unsigned int const Streams = basic_streams ) -> std::size_t;
|
auto draw( geometry_handle const &Geometry, stream_units const &Units, unsigned int Streams = basic_streams ) -> std::size_t;
|
||||||
// draws geometry stored in specified chunk N times via glDrawElementsInstanced*
|
// draws geometry stored in specified chunk N times via glDrawElementsInstanced*
|
||||||
auto draw_instanced( geometry_handle const &Geometry, stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams = basic_streams ) -> std::size_t;
|
auto draw_instanced( geometry_handle const &Geometry, stream_units const &Units, std::size_t InstanceCount, unsigned int Streams = basic_streams ) -> std::size_t;
|
||||||
// draws geometry stored in supplied list of chunks
|
// draws geometry stored in supplied list of chunks
|
||||||
template <typename Iterator_>
|
template <typename Iterator_>
|
||||||
auto draw( Iterator_ First, Iterator_ Last, stream_units const &Units, unsigned int const Streams = basic_streams ) ->std::size_t {
|
auto draw( Iterator_ First, Iterator_ Last, stream_units const &Units, unsigned int const Streams = basic_streams ) ->std::size_t {
|
||||||
@@ -164,11 +164,9 @@ protected:
|
|||||||
using geometrychunk_sequence = std::vector<geometry_chunk>;
|
using geometrychunk_sequence = std::vector<geometry_chunk>;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
inline
|
auto chunk( geometry_handle const Geometry ) -> geometry_chunk & {
|
||||||
auto chunk( geometry_handle const Geometry ) -> geometry_chunk & {
|
|
||||||
return m_chunks[ Geometry.chunk - 1 ]; }
|
return m_chunks[ Geometry.chunk - 1 ]; }
|
||||||
inline
|
auto chunk( geometry_handle const Geometry ) const -> geometry_chunk const & {
|
||||||
auto chunk( geometry_handle const Geometry ) const -> geometry_chunk const & {
|
|
||||||
return m_chunks[ Geometry.chunk - 1 ]; }
|
return m_chunks[ Geometry.chunk - 1 ]; }
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
@@ -181,7 +179,7 @@ private:
|
|||||||
// replace() subclass details
|
// replace() subclass details
|
||||||
virtual void replace_( geometry_handle const &Geometry ) = 0;
|
virtual void replace_( geometry_handle const &Geometry ) = 0;
|
||||||
// draw() subclass details
|
// draw() subclass details
|
||||||
virtual auto draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int const Streams ) -> std::size_t = 0;
|
virtual auto draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int Streams ) -> std::size_t = 0;
|
||||||
// draw_instanced() subclass details. Default implementation falls back to N regular draws.
|
// draw_instanced() subclass details. Default implementation falls back to N regular draws.
|
||||||
virtual auto draw_instanced_( geometry_handle const &Geometry, stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams ) -> std::size_t {
|
virtual auto draw_instanced_( geometry_handle const &Geometry, stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams ) -> std::size_t {
|
||||||
std::size_t count { 0 };
|
std::size_t count { 0 };
|
||||||
@@ -206,18 +204,18 @@ public:
|
|||||||
// registers a new geometry bank. returns: handle to the bank
|
// registers a new geometry bank. returns: handle to the bank
|
||||||
auto register_bank(std::unique_ptr<geometry_bank> bank) -> geometrybank_handle;
|
auto register_bank(std::unique_ptr<geometry_bank> bank) -> geometrybank_handle;
|
||||||
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
auto create_chunk( vertex_array &Vertices, userdata_array &Userdata, geometrybank_handle const &Geometry, int const Type ) -> geometry_handle;
|
auto create_chunk( vertex_array &Vertices, userdata_array &Userdata, geometrybank_handle const &Geometry, int Type ) -> geometry_handle;
|
||||||
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
auto create_chunk( index_array &Indices, vertex_array &Vertices, userdata_array &Userdata, geometrybank_handle const &Geometry, unsigned int const Type ) -> geometry_handle;
|
auto create_chunk( index_array &Indices, vertex_array &Vertices, userdata_array &Userdata, geometrybank_handle const &Geometry, unsigned int Type ) -> geometry_handle;
|
||||||
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
||||||
auto replace( vertex_array &Vertices, userdata_array &Userdata, geometry_handle const &Geometry, std::size_t const Offset = 0 ) -> bool;
|
auto replace( vertex_array &Vertices, userdata_array &Userdata, geometry_handle const &Geometry, std::size_t Offset = 0 ) -> bool;
|
||||||
// adds supplied vertex data at the end of specified chunk
|
// adds supplied vertex data at the end of specified chunk
|
||||||
auto append( vertex_array &Vertices, userdata_array &Userdata, geometry_handle const &Geometry ) -> bool;
|
auto append( vertex_array &Vertices, userdata_array &Userdata, geometry_handle const &Geometry ) -> bool;
|
||||||
// draws geometry stored in specified chunk
|
// draws geometry stored in specified chunk
|
||||||
void draw( geometry_handle const &Geometry, unsigned int const Streams = basic_streams );
|
void draw( geometry_handle const &Geometry, unsigned int Streams = basic_streams );
|
||||||
// draws geometry stored in specified chunk InstanceCount times via GPU instancing.
|
// draws geometry stored in specified chunk InstanceCount times via GPU instancing.
|
||||||
// The shader reads per-instance modelview matrices from instance_ubo[gl_InstanceID].
|
// The shader reads per-instance modelview matrices from instance_ubo[gl_InstanceID].
|
||||||
void draw_instanced( geometry_handle const &Geometry, std::size_t const InstanceCount, unsigned int const Streams = basic_streams );
|
void draw_instanced( geometry_handle const &Geometry, std::size_t InstanceCount, unsigned int Streams = basic_streams );
|
||||||
template <typename Iterator_>
|
template <typename Iterator_>
|
||||||
void draw( Iterator_ First, Iterator_ Last, unsigned int const Streams = basic_streams ) {
|
void draw( Iterator_ First, Iterator_ Last, unsigned int const Streams = basic_streams ) {
|
||||||
while( First != Last ) {
|
while( First != Last ) {
|
||||||
@@ -246,15 +244,12 @@ private:
|
|||||||
stream_units m_units;
|
stream_units m_units;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
inline
|
auto valid( geometry_handle const &Geometry ) const -> bool {
|
||||||
auto valid( geometry_handle const &Geometry ) const -> bool {
|
|
||||||
return ( ( Geometry.bank != 0 )
|
return ( ( Geometry.bank != 0 )
|
||||||
&& ( Geometry.bank <= m_geometrybanks.size() ) ); }
|
&& ( Geometry.bank <= m_geometrybanks.size() ) ); }
|
||||||
inline
|
auto bank( geometry_handle const Geometry ) -> geometrybanktimepointpair_sequence::value_type & {
|
||||||
auto bank( geometry_handle const Geometry ) -> geometrybanktimepointpair_sequence::value_type & {
|
|
||||||
return m_geometrybanks[ Geometry.bank - 1 ]; }
|
return m_geometrybanks[ Geometry.bank - 1 ]; }
|
||||||
inline
|
auto bank( geometry_handle const Geometry ) const -> geometrybanktimepointpair_sequence::value_type const & {
|
||||||
auto bank( geometry_handle const Geometry ) const -> geometrybanktimepointpair_sequence::value_type const & {
|
|
||||||
return m_geometrybanks[ Geometry.bank - 1 ]; }
|
return m_geometrybanks[ Geometry.bank - 1 ]; }
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ public:
|
|||||||
Render() override { return true; }
|
Render() override { return true; }
|
||||||
void
|
void
|
||||||
SwapBuffers() override {}
|
SwapBuffers() override {}
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
Framerate() override { return 10.0f; }
|
Framerate() override { return 10.0f; }
|
||||||
|
|
||||||
bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; }
|
bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; }
|
||||||
@@ -121,7 +120,7 @@ public:
|
|||||||
Texture( texture_handle const Texture ) const override { throw std::runtime_error("not impl"); }
|
Texture( texture_handle const Texture ) const override { throw std::runtime_error("not impl"); }
|
||||||
// utility methods
|
// utility methods
|
||||||
void
|
void
|
||||||
Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) override {}
|
Pick_Control_Callback( std::function<void( TSubModel const *, glm::vec2 )> Callback ) override {}
|
||||||
void
|
void
|
||||||
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override {}
|
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override {}
|
||||||
TSubModel const *
|
TSubModel const *
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ private:
|
|||||||
replace_( geometry_handle const &Geometry ) override;
|
replace_( geometry_handle const &Geometry ) override;
|
||||||
// draw() subclass details
|
// draw() subclass details
|
||||||
auto
|
auto
|
||||||
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int const Streams ) -> std::size_t override;
|
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int Streams ) -> std::size_t override;
|
||||||
// draw_instanced() subclass details — issues glDrawElementsInstancedBaseVertex
|
// draw_instanced() subclass details — issues glDrawElementsInstancedBaseVertex
|
||||||
auto
|
auto
|
||||||
draw_instanced_( geometry_handle const &Geometry, stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams ) -> std::size_t override;
|
draw_instanced_( geometry_handle const &Geometry, stream_units const &Units, std::size_t InstanceCount, unsigned int Streams ) -> std::size_t override;
|
||||||
// release() subclass details
|
// release() subclass details
|
||||||
void
|
void
|
||||||
release_() override;
|
release_() override;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ struct opengl33_light : public basic_light {
|
|||||||
|
|
||||||
float factor;
|
float factor;
|
||||||
|
|
||||||
void apply_intensity(float const Factor = 1.0f);
|
void apply_intensity(float Factor = 1.0f);
|
||||||
void apply_angle();
|
void apply_angle();
|
||||||
|
|
||||||
opengl33_light &operator=(basic_light const &Right) {
|
opengl33_light &operator=(basic_light const &Right) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
void create( int const Tesselation );
|
void create( int Tesselation );
|
||||||
// members
|
// members
|
||||||
std::vector<glm::vec3> m_vertices;
|
std::vector<glm::vec3> m_vertices;
|
||||||
std::vector<glm::vec2> m_uvs;
|
std::vector<glm::vec2> m_uvs;
|
||||||
|
|||||||
@@ -4920,7 +4920,7 @@ void opengl33_renderer::Update_Pick_Node()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void opengl33_renderer::Pick_Control_Callback(std::function<void(TSubModel const *, const glm::vec2 pos)> callback)
|
void opengl33_renderer::Pick_Control_Callback(std::function<void(TSubModel const *, glm::vec2 pos)> callback)
|
||||||
{
|
{
|
||||||
if (!Global.render_cab) {
|
if (!Global.render_cab) {
|
||||||
callback(nullptr, glm::vec2());
|
callback(nullptr, glm::vec2());
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
Render() override;
|
Render() override;
|
||||||
void
|
void
|
||||||
SwapBuffers() override;
|
SwapBuffers() override;
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
Framerate() override { return m_framerate; }
|
Framerate() override { return m_framerate; }
|
||||||
// geometry methods
|
// geometry methods
|
||||||
// NOTE: hands-on geometry management is exposed as a temporary measure; ultimately all visualization data should be generated/handled automatically by the renderer itself
|
// NOTE: hands-on geometry management is exposed as a temporary measure; ultimately all visualization data should be generated/handled automatically by the renderer itself
|
||||||
@@ -58,13 +57,13 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
gfx::geometrybank_handle
|
gfx::geometrybank_handle
|
||||||
Create_Bank() override;
|
Create_Bank() override;
|
||||||
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
gfx::geometry_handle Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) override;
|
gfx::geometry_handle Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) override;
|
||||||
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
gfx::geometry_handle Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) override;
|
gfx::geometry_handle Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) override;
|
||||||
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
||||||
bool Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset = 0) override;
|
bool Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type, std::size_t Offset = 0) override;
|
||||||
// adds supplied vertex data at the end of specified chunk
|
// adds supplied vertex data at the end of specified chunk
|
||||||
bool Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) override;
|
bool Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type) override;
|
||||||
// provides direct access to index data of specfied chunk
|
// provides direct access to index data of specfied chunk
|
||||||
gfx::index_array const &
|
gfx::index_array const &
|
||||||
Indices( gfx::geometry_handle const &Geometry ) const override;
|
Indices( gfx::geometry_handle const &Geometry ) const override;
|
||||||
@@ -76,27 +75,27 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
UserData( gfx::geometry_handle const &Geometry ) const override;
|
UserData( gfx::geometry_handle const &Geometry ) const override;
|
||||||
// material methods
|
// material methods
|
||||||
material_handle
|
material_handle
|
||||||
Fetch_Material( std::string const &Filename, bool const Loadnow = true ) override;
|
Fetch_Material( std::string const &Filename, bool Loadnow = true ) override;
|
||||||
void
|
void
|
||||||
Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override;
|
Bind_Material( material_handle Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override;
|
||||||
IMaterial const *
|
IMaterial const *
|
||||||
Material( material_handle const Material ) const override;
|
Material( material_handle Material ) const override;
|
||||||
// shader methods
|
// shader methods
|
||||||
auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> override;
|
auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> override;
|
||||||
// texture methods
|
// texture methods
|
||||||
texture_handle
|
texture_handle
|
||||||
Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override;
|
Fetch_Texture( std::string const &Filename, bool Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override;
|
||||||
void
|
void
|
||||||
Bind_Texture( texture_handle const Texture ) override;
|
Bind_Texture( texture_handle Texture ) override;
|
||||||
void
|
void
|
||||||
Bind_Texture( std::size_t const Unit, texture_handle const Texture ) override;
|
Bind_Texture( std::size_t Unit, texture_handle Texture ) override;
|
||||||
ITexture &
|
ITexture &
|
||||||
Texture( texture_handle const Texture ) override;
|
Texture( texture_handle Texture ) override;
|
||||||
ITexture const &
|
ITexture const &
|
||||||
Texture( texture_handle const Texture ) const override;
|
Texture( texture_handle Texture ) const override;
|
||||||
// utility methods
|
// utility methods
|
||||||
void
|
void
|
||||||
Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) override;
|
Pick_Control_Callback( std::function<void( TSubModel const *, glm::vec2 )> Callback ) override;
|
||||||
void
|
void
|
||||||
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override;
|
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override;
|
||||||
TSubModel const *
|
TSubModel const *
|
||||||
@@ -113,7 +112,7 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
Camera_Position() const override { return m_colorpass.pass_camera.position(); }
|
Camera_Position() const override { return m_colorpass.pass_camera.position(); }
|
||||||
// maintenance methods
|
// maintenance methods
|
||||||
void
|
void
|
||||||
Update( double const Deltatime ) override;
|
Update( double Deltatime ) override;
|
||||||
bool
|
bool
|
||||||
Debug_Ui_State(std::optional<bool>) override;
|
Debug_Ui_State(std::optional<bool>) override;
|
||||||
void
|
void
|
||||||
@@ -131,13 +130,13 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
opengl_material & Material( material_handle const Material );
|
opengl_material & Material( material_handle Material );
|
||||||
opengl_material const & Material( TSubModel const * Submodel ) const;
|
opengl_material const & Material( TSubModel const * Submodel ) const;
|
||||||
// draws supplied geometry handles
|
// draws supplied geometry handles
|
||||||
void Draw_Geometry(std::vector<gfx::geometrybank_handle>::iterator begin, std::vector<gfx::geometrybank_handle>::iterator end);
|
void Draw_Geometry(std::vector<gfx::geometrybank_handle>::iterator begin, std::vector<gfx::geometrybank_handle>::iterator end);
|
||||||
void Draw_Geometry(const gfx::geometrybank_handle &handle);
|
void Draw_Geometry(const gfx::geometrybank_handle &handle);
|
||||||
// material methods
|
// material methods
|
||||||
void Bind_Material_Shadow(material_handle const Material);
|
void Bind_Material_Shadow(material_handle Material);
|
||||||
void Update_AnimModel(TAnimModel *model);
|
void Update_AnimModel(TAnimModel *model);
|
||||||
|
|
||||||
// members
|
// members
|
||||||
@@ -257,24 +256,24 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
// methods
|
// methods
|
||||||
std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
|
std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
|
||||||
bool Init_caps();
|
bool Init_caps();
|
||||||
void setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode const Mode, float const Znear = 0.f, float const Zfar = 1.f, bool const Ignoredebug = false);
|
void setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode Mode, float Znear = 0.f, float Zfar = 1.f, bool Ignoredebug = false);
|
||||||
void setup_matrices();
|
void setup_matrices();
|
||||||
void setup_drawing(bool const Alpha = false);
|
void setup_drawing(bool Alpha = false);
|
||||||
void setup_shadow_unbind_map();
|
void setup_shadow_unbind_map();
|
||||||
void setup_shadow_bind_map();
|
void setup_shadow_bind_map();
|
||||||
void setup_shadow_color( glm::vec4 const &Shadowcolor );
|
void setup_shadow_color( glm::vec4 const &Shadowcolor );
|
||||||
void setup_env_map(gl::cubemap *tex);
|
void setup_env_map(gl::cubemap *tex);
|
||||||
void setup_environment_light(TEnvironmentType const Environment = e_flat);
|
void setup_environment_light(TEnvironmentType Environment = e_flat);
|
||||||
void setup_sunlight_intensity( float const Factor = 1.f);
|
void setup_sunlight_intensity( float Factor = 1.f);
|
||||||
// runs jobs needed to generate graphics for specified render pass
|
// runs jobs needed to generate graphics for specified render pass
|
||||||
void Render_pass(viewport_config &vp, rendermode const Mode);
|
void Render_pass(viewport_config &vp, rendermode Mode);
|
||||||
// creates dynamic environment cubemap
|
// creates dynamic environment cubemap
|
||||||
bool Render_reflections(viewport_config &vp);
|
bool Render_reflections(viewport_config &vp);
|
||||||
bool Render(world_environment *Environment);
|
bool Render(world_environment *Environment);
|
||||||
void Render(scene::basic_region *Region);
|
void Render(scene::basic_region *Region);
|
||||||
void Render(section_sequence::iterator First, section_sequence::iterator Last);
|
void Render(section_sequence::iterator First, section_sequence::iterator Last);
|
||||||
void Render(cell_sequence::iterator First, cell_sequence::iterator Last);
|
void Render(cell_sequence::iterator First, cell_sequence::iterator Last);
|
||||||
void Render(scene::shape_node const &Shape, bool const Ignorerange);
|
void Render(scene::shape_node const &Shape, bool Ignorerange);
|
||||||
void Render(TAnimModel *Instance);
|
void Render(TAnimModel *Instance);
|
||||||
// batched render path for many TAnimModel instances that share the same TModel3d.
|
// batched render path for many TAnimModel instances that share the same TModel3d.
|
||||||
// Caller guarantees every instance has m_instanceable == true (no per-instance lights,
|
// Caller guarantees every instance has m_instanceable == true (no per-instance lights,
|
||||||
@@ -283,8 +282,8 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
// instances counter. Instances are still individually frustum/distance culled.
|
// instances counter. Instances are still individually frustum/distance culled.
|
||||||
void Render_Instanced( TModel3d *Model, std::vector<TAnimModel *> const &Instances );
|
void Render_Instanced( TModel3d *Model, std::vector<TAnimModel *> const &Instances );
|
||||||
bool Render(TDynamicObject *Dynamic);
|
bool Render(TDynamicObject *Dynamic);
|
||||||
bool Render(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle);
|
bool Render(TModel3d *Model, material_data const *Material, float Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle);
|
||||||
bool Render(TModel3d *Model, material_data const *Material, float const Squaredistance);
|
bool Render(TModel3d *Model, material_data const *Material, float Squaredistance);
|
||||||
void Render(TSubModel *Submodel);
|
void Render(TSubModel *Submodel);
|
||||||
void Render(TTrack *Track);
|
void Render(TTrack *Track);
|
||||||
void Render(scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last);
|
void Render(scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last);
|
||||||
@@ -293,10 +292,10 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
// no-op if the track has no sleepermodel, Global.SleeperDistance is 0, or the camera is beyond
|
// no-op if the track has no sleepermodel, Global.SleeperDistance is 0, or the camera is beyond
|
||||||
// Global.SleeperDistance from the track origin.
|
// Global.SleeperDistance from the track origin.
|
||||||
void Render_Sleepers( TTrack *Track );
|
void Render_Sleepers( TTrack *Track );
|
||||||
bool Render_cab(TDynamicObject const *Dynamic, float const Lightlevel, bool const Alpha = false);
|
bool Render_cab(TDynamicObject const *Dynamic, float Lightlevel, bool Alpha = false);
|
||||||
bool Render_interior( bool const Alpha = false );
|
bool Render_interior( bool Alpha = false );
|
||||||
bool Render_lowpoly( TDynamicObject *Dynamic, float const Squaredistance, bool const Setup, bool const Alpha = false );
|
bool Render_lowpoly( TDynamicObject *Dynamic, float Squaredistance, bool Setup, bool Alpha = false );
|
||||||
bool Render_coupler_adapter( TDynamicObject *Dynamic, float const Squaredistance, int const End, bool const Alpha = false );
|
bool Render_coupler_adapter( TDynamicObject *Dynamic, float Squaredistance, int End, bool Alpha = false );
|
||||||
void Render(TMemCell *Memcell);
|
void Render(TMemCell *Memcell);
|
||||||
void Render_particles();
|
void Render_particles();
|
||||||
void Render_precipitation();
|
void Render_precipitation();
|
||||||
@@ -307,11 +306,11 @@ class opengl33_renderer : public gfx_renderer {
|
|||||||
void Render_Alpha(TTraction *Traction);
|
void Render_Alpha(TTraction *Traction);
|
||||||
void Render_Alpha(scene::lines_node const &Lines);
|
void Render_Alpha(scene::lines_node const &Lines);
|
||||||
bool Render_Alpha(TDynamicObject *Dynamic);
|
bool Render_Alpha(TDynamicObject *Dynamic);
|
||||||
bool Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle);
|
bool Render_Alpha(TModel3d *Model, material_data const *Material, float Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle);
|
||||||
bool Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance);
|
bool Render_Alpha(TModel3d *Model, material_data const *Material, float Squaredistance);
|
||||||
void Render_Alpha(TSubModel *Submodel);
|
void Render_Alpha(TSubModel *Submodel);
|
||||||
void Update_Lights(light_array &Lights);
|
void Update_Lights(light_array &Lights);
|
||||||
glm::vec3 pick_color(std::size_t const Index);
|
glm::vec3 pick_color(std::size_t Index);
|
||||||
std::size_t pick_index(glm::ivec3 const &Color);
|
std::size_t pick_index(glm::ivec3 const &Color);
|
||||||
|
|
||||||
bool init_viewport(viewport_config &vp);
|
bool init_viewport(viewport_config &vp);
|
||||||
|
|||||||
@@ -19,11 +19,9 @@ public:
|
|||||||
// constructors
|
// constructors
|
||||||
opengl_camera() = default;
|
opengl_camera() = default;
|
||||||
// methods:
|
// methods:
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
update_frustum() { update_frustum( m_projection, m_modelview ); }
|
update_frustum() { update_frustum( m_projection, m_modelview ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
update_frustum(glm::mat4 frustumtest_proj) {
|
update_frustum(glm::mat4 frustumtest_proj) {
|
||||||
update_frustum(frustumtest_proj, m_modelview); }
|
update_frustum(frustumtest_proj, m_modelview); }
|
||||||
void
|
void
|
||||||
@@ -32,26 +30,19 @@ public:
|
|||||||
visible( scene::bounding_area const &Area ) const;
|
visible( scene::bounding_area const &Area ) const;
|
||||||
bool
|
bool
|
||||||
visible( TDynamicObject const *Dynamic ) const;
|
visible( TDynamicObject const *Dynamic ) const;
|
||||||
inline
|
glm::dvec3 const &
|
||||||
glm::dvec3 const &
|
|
||||||
position() const { return m_position; }
|
position() const { return m_position; }
|
||||||
inline
|
glm::dvec3 &
|
||||||
glm::dvec3 &
|
|
||||||
position() { return m_position; }
|
position() { return m_position; }
|
||||||
inline
|
glm::mat4 const &
|
||||||
glm::mat4 const &
|
|
||||||
projection() const { return m_projection; }
|
projection() const { return m_projection; }
|
||||||
inline
|
glm::mat4 &
|
||||||
glm::mat4 &
|
|
||||||
projection() { return m_projection; }
|
projection() { return m_projection; }
|
||||||
inline
|
glm::mat4 const &
|
||||||
glm::mat4 const &
|
|
||||||
modelview() const { return m_modelview; }
|
modelview() const { return m_modelview; }
|
||||||
inline
|
glm::mat4 &
|
||||||
glm::mat4 &
|
|
||||||
modelview() { return m_modelview; }
|
modelview() { return m_modelview; }
|
||||||
inline
|
std::vector<glm::vec4> &
|
||||||
std::vector<glm::vec4> &
|
|
||||||
frustum_points() { return m_frustumpoints; }
|
frustum_points() { return m_frustumpoints; }
|
||||||
// transforms provided set of clip space points to world space
|
// transforms provided set of clip space points to world space
|
||||||
template <class Iterator_>
|
template <class Iterator_>
|
||||||
|
|||||||
@@ -19,39 +19,31 @@ public:
|
|||||||
opengl_color() = default;
|
opengl_color() = default;
|
||||||
|
|
||||||
// methods:
|
// methods:
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color3( glm::vec3 const &Color ) {
|
color3( glm::vec3 const &Color ) {
|
||||||
return color4( glm::vec4{ Color, 1.f } ); }
|
return color4( glm::vec4{ Color, 1.f } ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color3( float const Red, float const Green, float const Blue ) {
|
color3( float const Red, float const Green, float const Blue ) {
|
||||||
return color3( glm::vec3 { Red, Green, Blue } ); }
|
return color3( glm::vec3 { Red, Green, Blue } ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color3( float const *Value ) {
|
color3( float const *Value ) {
|
||||||
return color3( glm::make_vec3( Value ) ); }
|
return color3( glm::make_vec3( Value ) ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color4( glm::vec4 const &Color ) {
|
color4( glm::vec4 const &Color ) {
|
||||||
if( ( Color != m_color ) || ( false == Global.bUseVBO ) ) {
|
if( ( Color != m_color ) || ( false == Global.bUseVBO ) ) {
|
||||||
m_color = Color;
|
m_color = Color;
|
||||||
::glColor4fv( glm::value_ptr( m_color ) ); } }
|
::glColor4fv( glm::value_ptr( m_color ) ); } }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color4( float const Red, float const Green, float const Blue, float const Alpha ) {
|
color4( float const Red, float const Green, float const Blue, float const Alpha ) {
|
||||||
return color4( glm::vec4{ Red, Green, Blue, Alpha } ); }
|
return color4( glm::vec4{ Red, Green, Blue, Alpha } ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
color4( float const *Value ) {
|
color4( float const *Value ) {
|
||||||
return color4( glm::make_vec4( Value ) );
|
return color4( glm::make_vec4( Value ) );
|
||||||
}
|
}
|
||||||
inline
|
glm::vec4 const &
|
||||||
glm::vec4 const &
|
|
||||||
data() const {
|
data() const {
|
||||||
return m_color; }
|
return m_color; }
|
||||||
inline
|
float const *
|
||||||
float const *
|
|
||||||
data_array() const {
|
data_array() const {
|
||||||
return glm::value_ptr( m_color ); }
|
return glm::value_ptr( m_color ); }
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ private:
|
|||||||
replace_( geometry_handle const &Geometry ) override;
|
replace_( geometry_handle const &Geometry ) override;
|
||||||
// draw() subclass details
|
// draw() subclass details
|
||||||
auto
|
auto
|
||||||
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int const Streams ) -> std::size_t override;
|
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int Streams ) -> std::size_t override;
|
||||||
// release() subclass details
|
// release() subclass details
|
||||||
void
|
void
|
||||||
release_() override;
|
release_() override;
|
||||||
@@ -63,7 +63,7 @@ private:
|
|||||||
delete_buffer();
|
delete_buffer();
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
bind_streams(stream_units const &Units, unsigned int const Streams , size_t offset = 0);
|
bind_streams(stream_units const &Units, unsigned int Streams , size_t offset = 0);
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
release_streams();
|
release_streams();
|
||||||
@@ -109,7 +109,7 @@ private:
|
|||||||
replace_( geometry_handle const &Geometry ) override;
|
replace_( geometry_handle const &Geometry ) override;
|
||||||
// draw() subclass details
|
// draw() subclass details
|
||||||
auto
|
auto
|
||||||
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int const Streams ) -> std::size_t override;
|
draw_( geometry_handle const &Geometry, stream_units const &Units, unsigned int Streams ) -> std::size_t override;
|
||||||
// release () subclass details
|
// release () subclass details
|
||||||
void
|
void
|
||||||
release_() override;
|
release_() override;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct opengl_light : public basic_light {
|
|||||||
GLuint id { (GLuint)-1 };
|
GLuint id { (GLuint)-1 };
|
||||||
|
|
||||||
void
|
void
|
||||||
apply_intensity( float const Factor = 1.0f );
|
apply_intensity( float Factor = 1.0f );
|
||||||
void
|
void
|
||||||
apply_angle();
|
apply_angle();
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public:
|
|||||||
void
|
void
|
||||||
update( opengl_camera const &Camera );
|
update( opengl_camera const &Camera );
|
||||||
std::size_t
|
std::size_t
|
||||||
render( GLint const Textureunit );
|
render( GLint Textureunit );
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
struct particle_vertex {
|
struct particle_vertex {
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ public:
|
|||||||
void
|
void
|
||||||
update();
|
update();
|
||||||
void
|
void
|
||||||
render( GLint const Textureunit );
|
render( GLint Textureunit );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
void create( int const Tesselation );
|
void create( int Tesselation );
|
||||||
// members
|
// members
|
||||||
std::vector<glm::vec3> m_vertices;
|
std::vector<glm::vec3> m_vertices;
|
||||||
std::vector<glm::vec2> m_uvs;
|
std::vector<glm::vec2> m_uvs;
|
||||||
|
|||||||
@@ -1831,7 +1831,7 @@ opengl_renderer::Texture( texture_handle const Texture ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
opengl_renderer::Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) {
|
opengl_renderer::Pick_Control_Callback( std::function<void( TSubModel const *, glm::vec2 )> Callback ) {
|
||||||
|
|
||||||
m_control_pick_requests.emplace_back( Callback );
|
m_control_pick_requests.emplace_back( Callback );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ public:
|
|||||||
Render() override;
|
Render() override;
|
||||||
void
|
void
|
||||||
SwapBuffers() override;
|
SwapBuffers() override;
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
Framerate() override { return m_framerate; }
|
Framerate() override { return m_framerate; }
|
||||||
|
|
||||||
bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; }
|
bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; }
|
||||||
@@ -58,13 +57,13 @@ public:
|
|||||||
gfx::geometrybank_handle
|
gfx::geometrybank_handle
|
||||||
Create_Bank() override;
|
Create_Bank() override;
|
||||||
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
gfx::geometry_handle Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) override;
|
gfx::geometry_handle Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) override;
|
||||||
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
gfx::geometry_handle Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) override;
|
gfx::geometry_handle Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) override;
|
||||||
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
||||||
bool Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset = 0) override;
|
bool Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type, std::size_t Offset = 0) override;
|
||||||
// adds supplied vertex data at the end of specified chunk
|
// adds supplied vertex data at the end of specified chunk
|
||||||
bool Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) override;
|
bool Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type) override;
|
||||||
// provides direct access to index data of specfied chunk
|
// provides direct access to index data of specfied chunk
|
||||||
gfx::index_array const &
|
gfx::index_array const &
|
||||||
Indices( gfx::geometry_handle const &Geometry ) const override;
|
Indices( gfx::geometry_handle const &Geometry ) const override;
|
||||||
@@ -76,27 +75,27 @@ public:
|
|||||||
UserData( gfx::geometry_handle const &Geometry ) const override;
|
UserData( gfx::geometry_handle const &Geometry ) const override;
|
||||||
// material methods
|
// material methods
|
||||||
material_handle
|
material_handle
|
||||||
Fetch_Material( std::string const &Filename, bool const Loadnow = true ) override;
|
Fetch_Material( std::string const &Filename, bool Loadnow = true ) override;
|
||||||
void
|
void
|
||||||
Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override;
|
Bind_Material( material_handle Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override;
|
||||||
IMaterial const *
|
IMaterial const *
|
||||||
Material( material_handle const Material ) const override;
|
Material( material_handle Material ) const override;
|
||||||
// shader methods
|
// shader methods
|
||||||
auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> override;
|
auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> override;
|
||||||
// texture methods
|
// texture methods
|
||||||
texture_handle
|
texture_handle
|
||||||
Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override;
|
Fetch_Texture( std::string const &Filename, bool Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override;
|
||||||
void
|
void
|
||||||
Bind_Texture( texture_handle const Texture ) override;
|
Bind_Texture( texture_handle Texture ) override;
|
||||||
void
|
void
|
||||||
Bind_Texture( std::size_t const Unit, texture_handle const Texture ) override;
|
Bind_Texture( std::size_t Unit, texture_handle Texture ) override;
|
||||||
ITexture &
|
ITexture &
|
||||||
Texture( texture_handle const Texture ) override;
|
Texture( texture_handle Texture ) override;
|
||||||
ITexture const &
|
ITexture const &
|
||||||
Texture( texture_handle const Texture ) const override;
|
Texture( texture_handle Texture ) const override;
|
||||||
// utility methods
|
// utility methods
|
||||||
void
|
void
|
||||||
Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) override;
|
Pick_Control_Callback( std::function<void( TSubModel const *, glm::vec2 )> Callback ) override;
|
||||||
void
|
void
|
||||||
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override;
|
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override;
|
||||||
TSubModel const *
|
TSubModel const *
|
||||||
@@ -113,7 +112,7 @@ public:
|
|||||||
Camera_Position() const override { return m_colorpass.camera.position(); }
|
Camera_Position() const override { return m_colorpass.camera.position(); }
|
||||||
// maintenance methods
|
// maintenance methods
|
||||||
void
|
void
|
||||||
Update( double const Deltatime ) override;
|
Update( double Deltatime ) override;
|
||||||
void
|
void
|
||||||
Update_Pick_Control() override;
|
Update_Pick_Control() override;
|
||||||
void
|
void
|
||||||
@@ -190,27 +189,27 @@ private:
|
|||||||
void
|
void
|
||||||
Disable_Lights();
|
Disable_Lights();
|
||||||
void
|
void
|
||||||
setup_pass( renderpass_config &Config, rendermode const Mode, float const Znear = 0.f, float const Zfar = 1.f, bool const Ignoredebug = false );
|
setup_pass( renderpass_config &Config, rendermode Mode, float Znear = 0.f, float Zfar = 1.f, bool Ignoredebug = false );
|
||||||
void
|
void
|
||||||
setup_matrices();
|
setup_matrices();
|
||||||
void
|
void
|
||||||
setup_drawing( bool const Alpha = false );
|
setup_drawing( bool Alpha = false );
|
||||||
void
|
void
|
||||||
setup_units( bool const Diffuse, bool const Shadows, bool const Reflections );
|
setup_units( bool Diffuse, bool Shadows, bool Reflections );
|
||||||
void
|
void
|
||||||
setup_shadow_map( GLuint const Texture, glm::mat4 const &Transformation );
|
setup_shadow_map( GLuint Texture, glm::mat4 const &Transformation );
|
||||||
void
|
void
|
||||||
setup_shadow_color( glm::vec4 const &Shadowcolor );
|
setup_shadow_color( glm::vec4 const &Shadowcolor );
|
||||||
void
|
void
|
||||||
setup_environment_light( TEnvironmentType const Environment = e_flat );
|
setup_environment_light( TEnvironmentType Environment = e_flat );
|
||||||
void
|
void
|
||||||
switch_units( bool const Diffuse, bool const Shadows, bool const Reflections );
|
switch_units( bool Diffuse, bool Shadows, bool Reflections );
|
||||||
// helper, texture manager method; activates specified texture unit
|
// helper, texture manager method; activates specified texture unit
|
||||||
void
|
void
|
||||||
select_unit( GLint const Textureunit );
|
select_unit( GLint Textureunit );
|
||||||
// runs jobs needed to generate graphics for specified render pass
|
// runs jobs needed to generate graphics for specified render pass
|
||||||
void
|
void
|
||||||
Render_pass( rendermode const Mode );
|
Render_pass( rendermode Mode );
|
||||||
// creates dynamic environment cubemap
|
// creates dynamic environment cubemap
|
||||||
bool
|
bool
|
||||||
Render_reflections();
|
Render_reflections();
|
||||||
@@ -223,15 +222,15 @@ private:
|
|||||||
void
|
void
|
||||||
Render( cell_sequence::iterator First, cell_sequence::iterator Last );
|
Render( cell_sequence::iterator First, cell_sequence::iterator Last );
|
||||||
void
|
void
|
||||||
Render( scene::shape_node const &Shape, bool const Ignorerange );
|
Render( scene::shape_node const &Shape, bool Ignorerange );
|
||||||
void
|
void
|
||||||
Render( TAnimModel *Instance );
|
Render( TAnimModel *Instance );
|
||||||
bool
|
bool
|
||||||
Render( TDynamicObject *Dynamic );
|
Render( TDynamicObject *Dynamic );
|
||||||
bool
|
bool
|
||||||
Render( TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle );
|
Render( TModel3d *Model, material_data const *Material, float Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle );
|
||||||
bool
|
bool
|
||||||
Render( TModel3d *Model, material_data const *Material, float const Squaredistance );
|
Render( TModel3d *Model, material_data const *Material, float Squaredistance );
|
||||||
void
|
void
|
||||||
Render( TSubModel *Submodel );
|
Render( TSubModel *Submodel );
|
||||||
void
|
void
|
||||||
@@ -239,13 +238,13 @@ private:
|
|||||||
void
|
void
|
||||||
Render( scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last );
|
Render( scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last );
|
||||||
bool
|
bool
|
||||||
Render_cab( TDynamicObject const *Dynamic, float const Lightlevel, bool const Alpha = false );
|
Render_cab( TDynamicObject const *Dynamic, float Lightlevel, bool Alpha = false );
|
||||||
bool
|
bool
|
||||||
Render_interior( bool const Alpha = false );
|
Render_interior( bool Alpha = false );
|
||||||
bool
|
bool
|
||||||
Render_lowpoly( TDynamicObject *Dynamic, float const Squaredistance, bool const Setup, bool const Alpha = false );
|
Render_lowpoly( TDynamicObject *Dynamic, float Squaredistance, bool Setup, bool Alpha = false );
|
||||||
bool
|
bool
|
||||||
Render_coupler_adapter( TDynamicObject *Dynamic, float const Squaredistance, int const End, bool const Alpha = false );
|
Render_coupler_adapter( TDynamicObject *Dynamic, float Squaredistance, int End, bool Alpha = false );
|
||||||
void
|
void
|
||||||
Render( TMemCell *Memcell );
|
Render( TMemCell *Memcell );
|
||||||
void
|
void
|
||||||
@@ -265,9 +264,9 @@ private:
|
|||||||
bool
|
bool
|
||||||
Render_Alpha( TDynamicObject *Dynamic );
|
Render_Alpha( TDynamicObject *Dynamic );
|
||||||
bool
|
bool
|
||||||
Render_Alpha( TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle );
|
Render_Alpha( TModel3d *Model, material_data const *Material, float Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle );
|
||||||
bool
|
bool
|
||||||
Render_Alpha( TModel3d *Model, material_data const *Material, float const Squaredistance );
|
Render_Alpha( TModel3d *Model, material_data const *Material, float Squaredistance );
|
||||||
void
|
void
|
||||||
Render_Alpha( TSubModel *Submodel );
|
Render_Alpha( TSubModel *Submodel );
|
||||||
void
|
void
|
||||||
@@ -275,7 +274,7 @@ private:
|
|||||||
bool
|
bool
|
||||||
Init_caps();
|
Init_caps();
|
||||||
glm::vec3
|
glm::vec3
|
||||||
pick_color( std::size_t const Index );
|
pick_color( std::size_t Index );
|
||||||
std::size_t
|
std::size_t
|
||||||
pick_index( glm::ivec3 const &Color );
|
pick_index( glm::ivec3 const &Color );
|
||||||
|
|
||||||
@@ -367,7 +366,7 @@ private:
|
|||||||
std::vector<scene::basic_node *> m_picksceneryitems;
|
std::vector<scene::basic_node *> m_picksceneryitems;
|
||||||
scene::basic_node *m_picksceneryitem { nullptr };
|
scene::basic_node *m_picksceneryitem { nullptr };
|
||||||
glm::vec3 m_worldmousecoordinates { 0.f };
|
glm::vec3 m_worldmousecoordinates { 0.f };
|
||||||
std::vector<std::function<void( TSubModel const *, const glm::vec2 )>> m_control_pick_requests;
|
std::vector<std::function<void( TSubModel const *, glm::vec2 )>> m_control_pick_requests;
|
||||||
std::vector<std::function<void( scene::basic_node * )>> m_node_pick_requests;
|
std::vector<std::function<void( scene::basic_node * )>> m_node_pick_requests;
|
||||||
#ifdef EU07_USE_DEBUG_CAMERA
|
#ifdef EU07_USE_DEBUG_CAMERA
|
||||||
renderpass_config m_worldcamera; // debug item
|
renderpass_config m_worldcamera; // debug item
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
deserialize( cParser &Input );
|
deserialize( cParser &Input );
|
||||||
// updates state of provided variable
|
// updates state of provided variable
|
||||||
void
|
void
|
||||||
update( Type_ &Variable, double const Timedelta ) const;
|
update( Type_ &Variable, double Timedelta ) const;
|
||||||
void
|
void
|
||||||
bind( Type_ const *Modifier ) {
|
bind( Type_ const *Modifier ) {
|
||||||
m_valuechangemodifier = Modifier; }
|
m_valuechangemodifier = Modifier; }
|
||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
bind( TAnimModel const *Node );
|
bind( TAnimModel const *Node );
|
||||||
// updates state of owned particles
|
// updates state of owned particles
|
||||||
void
|
void
|
||||||
update( double const Timedelta, bool const Onlydespawn );
|
update( double Timedelta, bool Onlydespawn );
|
||||||
glm::vec3 const &
|
glm::vec3 const &
|
||||||
color() const {
|
color() const {
|
||||||
return m_emitter.color; }
|
return m_emitter.color; }
|
||||||
@@ -135,7 +135,7 @@ private:
|
|||||||
initialize( smoke_particle &Particle );
|
initialize( smoke_particle &Particle );
|
||||||
// updates state of provided particle and bounding box. returns: true if particle is still alive afterwards, false otherwise
|
// updates state of provided particle and bounding box. returns: true if particle is still alive afterwards, false otherwise
|
||||||
bool
|
bool
|
||||||
update( smoke_particle &Particle, bounding_box &Boundingbox, double const Timedelta );
|
update( smoke_particle &Particle, bounding_box &Boundingbox, double Timedelta );
|
||||||
// members
|
// members
|
||||||
// config/inputs
|
// config/inputs
|
||||||
// TBD: union and indicator, or just plain owner variables?
|
// TBD: union and indicator, or just plain owner variables?
|
||||||
@@ -176,11 +176,11 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// adds a new particle source of specified type, placing it in specified world location. returns: true on success, false if the specified type definition couldn't be located
|
// adds a new particle source of specified type, placing it in specified world location. returns: true on success, false if the specified type definition couldn't be located
|
||||||
bool
|
bool
|
||||||
insert( std::string const &Sourcetemplate, glm::dvec3 const Location );
|
insert( std::string const &Sourcetemplate, glm::dvec3 Location );
|
||||||
bool
|
bool
|
||||||
insert( std::string const &Sourcetemplate, TDynamicObject const *Vehicle, glm::dvec3 const Location );
|
insert( std::string const &Sourcetemplate, TDynamicObject const *Vehicle, glm::dvec3 Location );
|
||||||
bool
|
bool
|
||||||
insert( std::string const &Sourcetemplate, TAnimModel const *Node, glm::dvec3 const Location );
|
insert( std::string const &Sourcetemplate, TAnimModel const *Node, glm::dvec3 Location );
|
||||||
// updates state of all owned emitters
|
// updates state of all owned emitters
|
||||||
void
|
void
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ public:
|
|||||||
// creates a new geometry bank. returns: handle to the bank or NULL
|
// creates a new geometry bank. returns: handle to the bank or NULL
|
||||||
virtual auto Create_Bank() -> gfx::geometrybank_handle = 0;
|
virtual auto Create_Bank() -> gfx::geometrybank_handle = 0;
|
||||||
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
virtual auto Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) -> gfx::geometry_handle = 0;
|
virtual auto Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) -> gfx::geometry_handle = 0;
|
||||||
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
|
||||||
virtual auto Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) -> gfx::geometry_handle = 0;
|
virtual auto Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int Type) -> gfx::geometry_handle = 0;
|
||||||
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
|
||||||
virtual auto Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset = 0) -> bool = 0;
|
virtual auto Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type, std::size_t Offset = 0) -> bool = 0;
|
||||||
// adds supplied vertex data at the end of specified chunk
|
// adds supplied vertex data at the end of specified chunk
|
||||||
virtual auto Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) -> bool = 0;
|
virtual auto Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int Type) -> bool = 0;
|
||||||
// provides direct access to index data of specfied chunk
|
// provides direct access to index data of specfied chunk
|
||||||
virtual auto Indices( gfx::geometry_handle const &Geometry ) const->gfx::index_array const & = 0;
|
virtual auto Indices( gfx::geometry_handle const &Geometry ) const->gfx::index_array const & = 0;
|
||||||
// provides direct access to vertex data of specfied chunk
|
// provides direct access to vertex data of specfied chunk
|
||||||
@@ -55,19 +55,19 @@ public:
|
|||||||
// provides direct access to vertex user data of specfied chunk
|
// provides direct access to vertex user data of specfied chunk
|
||||||
virtual auto UserData( gfx::geometry_handle const &Geometry ) const ->gfx::userdata_array const & = 0;
|
virtual auto UserData( gfx::geometry_handle const &Geometry ) const ->gfx::userdata_array const & = 0;
|
||||||
// material methods
|
// material methods
|
||||||
virtual auto Fetch_Material( std::string const &Filename, bool const Loadnow = true ) -> material_handle = 0;
|
virtual auto Fetch_Material( std::string const &Filename, bool Loadnow = true ) -> material_handle = 0;
|
||||||
virtual void Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) = 0;
|
virtual void Bind_Material( material_handle Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) = 0;
|
||||||
virtual auto Material( material_handle const Material ) const -> IMaterial const * = 0;
|
virtual auto Material( material_handle Material ) const -> IMaterial const * = 0;
|
||||||
// shader methods
|
// shader methods
|
||||||
virtual auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> = 0;
|
virtual auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> = 0;
|
||||||
// texture methods
|
// texture methods
|
||||||
virtual auto Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) -> texture_handle = 0;
|
virtual auto Fetch_Texture( std::string const &Filename, bool Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) -> texture_handle = 0;
|
||||||
virtual void Bind_Texture( texture_handle const Texture ) = 0;
|
virtual void Bind_Texture( texture_handle Texture ) = 0;
|
||||||
virtual void Bind_Texture( std::size_t const Unit, texture_handle const Texture ) = 0;
|
virtual void Bind_Texture( std::size_t Unit, texture_handle Texture ) = 0;
|
||||||
virtual auto Texture( texture_handle const Texture ) -> ITexture & = 0;
|
virtual auto Texture( texture_handle Texture ) -> ITexture & = 0;
|
||||||
virtual auto Texture( texture_handle const Texture ) const -> ITexture const & = 0;
|
virtual auto Texture( texture_handle Texture ) const -> ITexture const & = 0;
|
||||||
// utility methods
|
// utility methods
|
||||||
virtual void Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) = 0;
|
virtual void Pick_Control_Callback( std::function<void( TSubModel const *, glm::vec2 )> Callback ) = 0;
|
||||||
virtual void Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) = 0;
|
virtual void Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) = 0;
|
||||||
virtual auto Pick_Control() const -> TSubModel const * = 0;
|
virtual auto Pick_Control() const -> TSubModel const * = 0;
|
||||||
virtual auto Pick_Node() const -> scene::basic_node const * = 0;
|
virtual auto Pick_Node() const -> scene::basic_node const * = 0;
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
virtual auto Camera_Projection_Matrix() const -> glm::mat4 { return glm::mat4( 1.f ); }
|
virtual auto Camera_Projection_Matrix() const -> glm::mat4 { return glm::mat4( 1.f ); }
|
||||||
virtual auto Camera_Position() const -> glm::dvec3 { return glm::dvec3( 0.0 ); }
|
virtual auto Camera_Position() const -> glm::dvec3 { return glm::dvec3( 0.0 ); }
|
||||||
// maintenance methods
|
// maintenance methods
|
||||||
virtual void Update( double const Deltatime ) = 0;
|
virtual void Update( double Deltatime ) = 0;
|
||||||
virtual void Update_Pick_Control() = 0;
|
virtual void Update_Pick_Control() = 0;
|
||||||
virtual void Update_Pick_Node() = 0;
|
virtual void Update_Pick_Node() = 0;
|
||||||
virtual auto Update_Mouse_Position() -> glm::dvec3 = 0;
|
virtual auto Update_Mouse_Position() -> glm::dvec3 = 0;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
on_click( TAnimModel const *Instance );
|
on_click( TAnimModel const *Instance );
|
||||||
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
||||||
void
|
void
|
||||||
update_traction( TDynamicObject *Vehicle, int const Pantographindex );
|
update_traction( TDynamicObject *Vehicle, int Pantographindex );
|
||||||
// legacy method, polls event launchers within radius around specified point
|
// legacy method, polls event launchers within radius around specified point
|
||||||
void
|
void
|
||||||
update_events();
|
update_events();
|
||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
RaTrackAnimAdd( TTrack *Track );
|
RaTrackAnimAdd( TTrack *Track );
|
||||||
// legacy method, updates geometry for pieces in the animation list
|
// legacy method, updates geometry for pieces in the animation list
|
||||||
void
|
void
|
||||||
RaAnimate( unsigned int const Framestamp );
|
RaAnimate( unsigned int Framestamp );
|
||||||
// sends content of the class to provided stream
|
// sends content of the class to provided stream
|
||||||
void
|
void
|
||||||
serialize( std::ostream &Output ) const;
|
serialize( std::ostream &Output ) const;
|
||||||
@@ -153,7 +153,7 @@ public:
|
|||||||
erase( TMemCell *Memorycell );
|
erase( TMemCell *Memorycell );
|
||||||
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
||||||
std::tuple<TDynamicObject *, float>
|
std::tuple<TDynamicObject *, float>
|
||||||
find( glm::dvec3 const &Point, float const Radius, bool const Onlycontrolled, bool const Findbycoupler ) const;
|
find( glm::dvec3 const &Point, float Radius, bool Onlycontrolled, bool Findbycoupler ) const;
|
||||||
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
||||||
std::tuple<TTrack *, int>
|
std::tuple<TTrack *, int>
|
||||||
find( glm::dvec3 const &Point, TTrack const *Exclude ) const;
|
find( glm::dvec3 const &Point, TTrack const *Exclude ) const;
|
||||||
@@ -162,7 +162,7 @@ public:
|
|||||||
find( glm::dvec3 const &Point, TTraction const *Exclude ) const;
|
find( glm::dvec3 const &Point, TTraction const *Exclude ) const;
|
||||||
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
||||||
std::tuple<TTraction *, int, float>
|
std::tuple<TTraction *, int, float>
|
||||||
find( glm::dvec3 const &Point, TTraction const *Other, int const Currentdirection ) const;
|
find( glm::dvec3 const &Point, TTraction const *Other, int Currentdirection ) const;
|
||||||
// sets center point of the cell
|
// sets center point of the cell
|
||||||
void
|
void
|
||||||
center( glm::dvec3 Center );
|
center( glm::dvec3 Center );
|
||||||
@@ -170,7 +170,7 @@ public:
|
|||||||
void
|
void
|
||||||
create_geometry( gfx::geometrybank_handle const &Bank );
|
create_geometry( gfx::geometrybank_handle const &Bank );
|
||||||
void
|
void
|
||||||
create_map_geometry(std::vector<gfx::basic_vertex> &Bank, const gfx::geometrybank_handle Extra);
|
create_map_geometry(std::vector<gfx::basic_vertex> &Bank, gfx::geometrybank_handle Extra);
|
||||||
void
|
void
|
||||||
get_map_active_paths(map_colored_paths &handles);
|
get_map_active_paths(map_colored_paths &handles);
|
||||||
glm::vec3 find_nearest_track_point(const glm::dvec3 &pos);
|
glm::vec3 find_nearest_track_point(const glm::dvec3 &pos);
|
||||||
@@ -261,16 +261,16 @@ public:
|
|||||||
on_click( TAnimModel const *Instance );
|
on_click( TAnimModel const *Instance );
|
||||||
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
||||||
void
|
void
|
||||||
update_traction( TDynamicObject *Vehicle, int const Pantographindex );
|
update_traction( TDynamicObject *Vehicle, int Pantographindex );
|
||||||
// legacy method, updates sounds and polls event launchers within radius around specified point
|
// legacy method, updates sounds and polls event launchers within radius around specified point
|
||||||
void
|
void
|
||||||
update_events( glm::dvec3 const &Location, float const Radius );
|
update_events( glm::dvec3 const &Location, float Radius );
|
||||||
// legacy method, updates sounds and polls event launchers within radius around specified point
|
// legacy method, updates sounds and polls event launchers within radius around specified point
|
||||||
void
|
void
|
||||||
update_sounds( glm::dvec3 const &Location, float const Radius );
|
update_sounds( glm::dvec3 const &Location, float Radius );
|
||||||
// legacy method, triggers radio-stop procedure for all vehicles in 2km radius around specified location
|
// legacy method, triggers radio-stop procedure for all vehicles in 2km radius around specified location
|
||||||
void
|
void
|
||||||
radio_stop( glm::dvec3 const &Location, float const Radius );
|
radio_stop( glm::dvec3 const &Location, float Radius );
|
||||||
// sends content of the class to provided stream
|
// sends content of the class to provided stream
|
||||||
void
|
void
|
||||||
serialize( std::ostream &Output ) const;
|
serialize( std::ostream &Output ) const;
|
||||||
@@ -310,7 +310,7 @@ public:
|
|||||||
cell( Point ).register_end( Node ); }
|
cell( Point ).register_end( Node ); }
|
||||||
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
||||||
std::tuple<TDynamicObject *, float>
|
std::tuple<TDynamicObject *, float>
|
||||||
find( glm::dvec3 const &Point, float const Radius, bool const Onlycontrolled, bool const Findbycoupler );
|
find( glm::dvec3 const &Point, float Radius, bool Onlycontrolled, bool Findbycoupler );
|
||||||
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
||||||
std::tuple<TTrack *, int>
|
std::tuple<TTrack *, int>
|
||||||
find( glm::dvec3 const &Point, TTrack const *Exclude );
|
find( glm::dvec3 const &Point, TTrack const *Exclude );
|
||||||
@@ -319,7 +319,7 @@ public:
|
|||||||
find( glm::dvec3 const &Point, TTraction const *Exclude );
|
find( glm::dvec3 const &Point, TTraction const *Exclude );
|
||||||
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
||||||
std::tuple<TTraction *, int, float>
|
std::tuple<TTraction *, int, float>
|
||||||
find( glm::dvec3 const &Point, TTraction const *Other, int const Currentdirection );
|
find( glm::dvec3 const &Point, TTraction const *Other, int Currentdirection );
|
||||||
// sets center point of the section
|
// sets center point of the section
|
||||||
void
|
void
|
||||||
center( glm::dvec3 Center );
|
center( glm::dvec3 Center );
|
||||||
@@ -327,7 +327,7 @@ public:
|
|||||||
void
|
void
|
||||||
create_geometry();
|
create_geometry();
|
||||||
void
|
void
|
||||||
create_map_geometry(const gfx::geometrybank_handle handle);
|
create_map_geometry(gfx::geometrybank_handle handle);
|
||||||
void
|
void
|
||||||
get_map_active_paths(map_colored_paths &handles);
|
get_map_active_paths(map_colored_paths &handles);
|
||||||
// provides access to bounding area data
|
// provides access to bounding area data
|
||||||
@@ -379,7 +379,7 @@ public:
|
|||||||
on_click( TAnimModel const *Instance );
|
on_click( TAnimModel const *Instance );
|
||||||
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
// legacy method, finds and assigns traction piece to specified pantograph of provided vehicle
|
||||||
void
|
void
|
||||||
update_traction( TDynamicObject *Vehicle, int const Pantographindex );
|
update_traction( TDynamicObject *Vehicle, int Pantographindex );
|
||||||
// legacy method, polls event launchers around camera
|
// legacy method, polls event launchers around camera
|
||||||
void
|
void
|
||||||
update_events();
|
update_events();
|
||||||
@@ -406,7 +406,7 @@ public:
|
|||||||
RadioStop( glm::dvec3 const &Location );
|
RadioStop( glm::dvec3 const &Location );
|
||||||
// inserts provided shape in the region
|
// inserts provided shape in the region
|
||||||
void
|
void
|
||||||
insert( shape_node Shape, scratch_data &Scratchpad, bool const Transform );
|
insert( shape_node Shape, scratch_data &Scratchpad, bool Transform );
|
||||||
// inserts provided lines in the region
|
// inserts provided lines in the region
|
||||||
void
|
void
|
||||||
insert( lines_node Lines, scratch_data &Scratchpad );
|
insert( lines_node Lines, scratch_data &Scratchpad );
|
||||||
@@ -437,7 +437,7 @@ public:
|
|||||||
section( location ).erase( Node ); } }
|
section( location ).erase( Node ); } }
|
||||||
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
|
||||||
std::tuple<TDynamicObject *, float>
|
std::tuple<TDynamicObject *, float>
|
||||||
find_vehicle( glm::dvec3 const &Point, float const Radius, bool const Onlycontrolled, bool const Findbycoupler );
|
find_vehicle( glm::dvec3 const &Point, float Radius, bool Onlycontrolled, bool Findbycoupler );
|
||||||
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
||||||
std::tuple<TTrack *, int>
|
std::tuple<TTrack *, int>
|
||||||
find_path( glm::dvec3 const &Point, TTrack const *Exclude );
|
find_path( glm::dvec3 const &Point, TTrack const *Exclude );
|
||||||
@@ -446,10 +446,10 @@ public:
|
|||||||
find_traction( glm::dvec3 const &Point, TTraction const *Exclude );
|
find_traction( glm::dvec3 const &Point, TTraction const *Exclude );
|
||||||
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
// finds a traction piece located nearest to specified point, sharing section with specified other piece and powered in specified direction. returns: located traction piece
|
||||||
std::tuple<TTraction *, int>
|
std::tuple<TTraction *, int>
|
||||||
find_traction( glm::dvec3 const &Point, TTraction const *Other, int const Currentdirection );
|
find_traction( glm::dvec3 const &Point, TTraction const *Other, int Currentdirection );
|
||||||
// finds sections inside specified sphere. returns: list of sections
|
// finds sections inside specified sphere. returns: list of sections
|
||||||
std::vector<basic_section *> const &
|
std::vector<basic_section *> const &
|
||||||
sections( glm::dvec3 const &Point, float const Radius );
|
sections( glm::dvec3 const &Point, float Radius );
|
||||||
void
|
void
|
||||||
create_map_geometry();
|
create_map_geometry();
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -33,26 +33,26 @@ class basic_editor {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void
|
void
|
||||||
translate( basic_node *Node, glm::dvec3 const &Location, bool const Snaptoground );
|
translate( basic_node *Node, glm::dvec3 const &Location, bool Snaptoground );
|
||||||
void
|
void
|
||||||
translate( basic_node *Node, float const Offset );
|
translate( basic_node *Node, float Offset );
|
||||||
void
|
void
|
||||||
rotate( basic_node *Node, glm::vec3 const &Angle, float const Quantization );
|
rotate( basic_node *Node, glm::vec3 const &Angle, float Quantization );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
void
|
void
|
||||||
translate_node( basic_node *Node, glm::dvec3 const &Location );
|
translate_node( basic_node *Node, glm::dvec3 const &Location );
|
||||||
void
|
void
|
||||||
translate_node( basic_node *Node, float const Offset );
|
translate_node( basic_node *Node, float Offset );
|
||||||
void
|
void
|
||||||
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
|
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
|
||||||
void
|
void
|
||||||
translate_instance( TAnimModel *Instance, float const Offset );
|
translate_instance( TAnimModel *Instance, float Offset );
|
||||||
void
|
void
|
||||||
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
|
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
|
||||||
void
|
void
|
||||||
translate_memorycell( TMemCell *Memorycell, float const Offset );
|
translate_memorycell( TMemCell *Memorycell, float Offset );
|
||||||
void
|
void
|
||||||
rotate_node( basic_node *Node, glm::vec3 const &Angle );
|
rotate_node( basic_node *Node, glm::vec3 const &Angle );
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ struct bounding_area {
|
|||||||
serialize( std::ostream &Output ) const;
|
serialize( std::ostream &Output ) const;
|
||||||
// restores content of the struct from provided input stream.
|
// restores content of the struct from provided input stream.
|
||||||
void
|
void
|
||||||
deserialize( std::istream &Input, bool const Preserveradius = true );
|
deserialize( std::istream &Input, bool Preserveradius = true );
|
||||||
};
|
};
|
||||||
|
|
||||||
//using group_handle = std::size_t;
|
//using group_handle = std::size_t;
|
||||||
@@ -121,7 +121,7 @@ public:
|
|||||||
// builds an opaque, always-visible shape from a world-space GL_TRIANGLES vertex list, stored
|
// builds an opaque, always-visible shape from a world-space GL_TRIANGLES vertex list, stored
|
||||||
// relative to Origin. used by the editor's terrain to own editable geometry it can re-upload.
|
// relative to Origin. used by the editor's terrain to own editable geometry it can re-upload.
|
||||||
shape_node &
|
shape_node &
|
||||||
make_terrain( material_handle const Material, std::vector<world_vertex> Vertices, glm::dvec3 const Origin );
|
make_terrain( material_handle Material, std::vector<world_vertex> Vertices, glm::dvec3 Origin );
|
||||||
// adds content of provided node to already enclosed geometry. returns: true if merge could be performed
|
// adds content of provided node to already enclosed geometry. returns: true if merge could be performed
|
||||||
bool
|
bool
|
||||||
merge( shape_node &Shape );
|
merge( shape_node &Shape );
|
||||||
@@ -344,7 +344,7 @@ public:
|
|||||||
name() const;
|
name() const;
|
||||||
virtual std::string tooltip() const;
|
virtual std::string tooltip() const;
|
||||||
void
|
void
|
||||||
location( glm::dvec3 const Location );
|
location( glm::dvec3 Location );
|
||||||
glm::dvec3 const &
|
glm::dvec3 const &
|
||||||
location() const;
|
location() const;
|
||||||
glm::dvec3 &
|
glm::dvec3 &
|
||||||
@@ -352,7 +352,7 @@ public:
|
|||||||
float const &
|
float const &
|
||||||
radius();
|
radius();
|
||||||
void
|
void
|
||||||
visible( bool const Visible );
|
visible( bool Visible );
|
||||||
bool
|
bool
|
||||||
visible() const;
|
visible() const;
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -42,17 +42,17 @@ public:
|
|||||||
handle() const;
|
handle() const;
|
||||||
// places provided node in specified group
|
// places provided node in specified group
|
||||||
void
|
void
|
||||||
insert( group_handle const Group, basic_node *Node );
|
insert( group_handle Group, basic_node *Node );
|
||||||
// places provided event in specified group
|
// places provided event in specified group
|
||||||
void
|
void
|
||||||
insert( group_handle const Group, basic_event *Event );
|
insert( group_handle Group, basic_event *Event );
|
||||||
// grants direct access to specified group
|
// grants direct access to specified group
|
||||||
basic_group &
|
basic_group &
|
||||||
group( group_handle const Group ) {
|
group( group_handle const Group ) {
|
||||||
return m_groupmap[ Group ]; }
|
return m_groupmap[ Group ]; }
|
||||||
// sends basic content of the class in legacy (text) format to provided stream
|
// sends basic content of the class in legacy (text) format to provided stream
|
||||||
void
|
void
|
||||||
export_as_text( std::ostream &Output, bool const Dirty ) const;
|
export_as_text( std::ostream &Output, bool Dirty ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// types
|
// types
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class python_taskqueue
|
|||||||
using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
||||||
using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
||||||
// methods
|
// methods
|
||||||
auto fetch_renderer(std::string const Renderer) -> PyObject *;
|
auto fetch_renderer(std::string Renderer) -> PyObject *;
|
||||||
void run(GLFWwindow *Context, rendertask_sequence &Tasks, uploadtask_sequence &Upload_Tasks, threading::condition_variable &Condition, std::atomic<bool> &Exit);
|
void run(GLFWwindow *Context, rendertask_sequence &Tasks, uploadtask_sequence &Upload_Tasks, threading::condition_variable &Condition, std::atomic<bool> &Exit);
|
||||||
void error();
|
void error();
|
||||||
|
|
||||||
|
|||||||
@@ -61,13 +61,13 @@ class basic_controller {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
auto load( std::string const &Filename ) -> bool;
|
auto load( std::string const &Filename ) -> bool;
|
||||||
auto update( double const Timestep ) -> int;
|
auto update( double Timestep ) -> int;
|
||||||
// finds element with specified name, potentially creating new element of specified type initialized with provided arguments. returns: handle to the element
|
// finds element with specified name, potentially creating new element of specified type initialized with provided arguments. returns: handle to the element
|
||||||
template<typename ...Args_>
|
template<typename ...Args_>
|
||||||
auto find_or_insert( std::string const &Name, basic_element::type_e Type = basic_element::type_e::variable, Args_ ...Args ) -> element_handle;
|
auto find_or_insert( std::string const &Name, basic_element::type_e Type = basic_element::type_e::variable, Args_ ...Args ) -> element_handle;
|
||||||
// data access
|
// data access
|
||||||
auto input( element_handle const Element ) -> int &;
|
auto input( element_handle Element ) -> int &;
|
||||||
auto output( element_handle const Element ) const -> int;
|
auto output( element_handle Element ) const -> int;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//types
|
//types
|
||||||
@@ -100,20 +100,17 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
auto deserialize_operation( cParser &Input ) -> bool;
|
auto deserialize_operation( cParser &Input ) -> bool;
|
||||||
// adds provided item to the collection. returns: true if there's no duplicate with the same name, false otherwise
|
// adds provided item to the collection. returns: true if there's no duplicate with the same name, false otherwise
|
||||||
auto insert( std::string const Name, basic_element Element ) -> element_handle;
|
auto insert( std::string Name, basic_element Element ) -> element_handle;
|
||||||
// runs one cycle of current program. returns: error code or 0 if there's no error
|
// runs one cycle of current program. returns: error code or 0 if there's no error
|
||||||
auto run() -> int;
|
auto run() -> int;
|
||||||
void log_error( std::string const &Error, int const Line = -1 ) const;
|
void log_error( std::string const &Error, int Line = -1 ) const;
|
||||||
auto guess_element_type_from_name( std::string const &Name ) const->basic_element::type_e;
|
auto guess_element_type_from_name( std::string const &Name ) const->basic_element::type_e;
|
||||||
inline
|
auto inverse( int const Value ) const -> int {
|
||||||
auto inverse( int const Value ) const -> int {
|
|
||||||
return Value == 0 ? 1 : 0; }
|
return Value == 0 ? 1 : 0; }
|
||||||
// element access
|
// element access
|
||||||
inline
|
auto element( element_handle const Element ) const -> basic_element const {
|
||||||
auto element( element_handle const Element ) const -> basic_element const {
|
|
||||||
return m_elements[ Element - 1 ]; }
|
return m_elements[ Element - 1 ]; }
|
||||||
inline
|
auto element( element_handle const Element ) -> basic_element & {
|
||||||
auto element( element_handle const Element ) -> basic_element & {
|
|
||||||
return m_elements[ Element - 1 ]; }
|
return m_elements[ Element - 1 ]; }
|
||||||
// members
|
// members
|
||||||
static std::map<std::string, opcode_e> const m_operationcodemap;
|
static std::map<std::string, opcode_e> const m_operationcodemap;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// passes specified sound to all vehicles within range as a radio message broadcasted on specified channel
|
// passes specified sound to all vehicles within range as a radio message broadcasted on specified channel
|
||||||
void radio_message( sound_source *Message, int const Channel );
|
void radio_message( sound_source *Message, int Channel );
|
||||||
|
|
||||||
extern state_manager State;
|
extern state_manager State;
|
||||||
extern event_manager Events;
|
extern event_manager Events;
|
||||||
|
|||||||
@@ -32,36 +32,36 @@ public:
|
|||||||
void update();
|
void update();
|
||||||
void update_precipitation();
|
void update_precipitation();
|
||||||
void update_moon();
|
void update_moon();
|
||||||
void time( int const Hour = -1, int const Minute = -1, int const Second = -1 );
|
void time( int Hour = -1, int Minute = -1, int Second = -1 );
|
||||||
// switches between static and dynamic daylight calculation
|
// switches between static and dynamic daylight calculation
|
||||||
void on_daylight_change();
|
void on_daylight_change();
|
||||||
// calculates current season of the year based on set simulation date
|
// calculates current season of the year based on set simulation date
|
||||||
void compute_season( int const Yearday );
|
void compute_season( int Yearday );
|
||||||
// calculates current weather
|
// calculates current weather
|
||||||
void compute_weather();
|
void compute_weather();
|
||||||
// data access
|
// data access
|
||||||
inline auto const &
|
auto const &
|
||||||
sun() const {
|
sun() const {
|
||||||
return m_sun; }
|
return m_sun; }
|
||||||
inline auto const &
|
auto const &
|
||||||
moon() const {
|
moon() const {
|
||||||
return m_moon; }
|
return m_moon; }
|
||||||
inline auto const &
|
auto const &
|
||||||
light_intensity() const {
|
light_intensity() const {
|
||||||
return m_lightintensity; }
|
return m_lightintensity; }
|
||||||
inline auto const &
|
auto const &
|
||||||
skydome() const {
|
skydome() const {
|
||||||
return m_skydome; }
|
return m_skydome; }
|
||||||
inline auto &
|
auto &
|
||||||
skydome() {
|
skydome() {
|
||||||
return m_skydome; }
|
return m_skydome; }
|
||||||
inline auto const &
|
auto const &
|
||||||
precipitation() const {
|
precipitation() const {
|
||||||
return m_precipitation; }
|
return m_precipitation; }
|
||||||
inline auto const &
|
auto const &
|
||||||
wind() const {
|
wind() const {
|
||||||
return m_wind.vector; }
|
return m_wind.vector; }
|
||||||
inline auto const &
|
auto const &
|
||||||
wind_azimuth() const {
|
wind_azimuth() const {
|
||||||
return m_wind.azimuth; }
|
return m_wind.azimuth; }
|
||||||
|
|
||||||
|
|||||||
@@ -22,27 +22,22 @@ public:
|
|||||||
void
|
void
|
||||||
init(time_t timestamp = 0);
|
init(time_t timestamp = 0);
|
||||||
void
|
void
|
||||||
update( double const Deltatime );
|
update( double Deltatime );
|
||||||
inline
|
SYSTEMTIME &
|
||||||
SYSTEMTIME &
|
|
||||||
data() {
|
data() {
|
||||||
return m_time; }
|
return m_time; }
|
||||||
inline
|
SYSTEMTIME const &
|
||||||
SYSTEMTIME const &
|
|
||||||
data() const {
|
data() const {
|
||||||
return m_time; }
|
return m_time; }
|
||||||
inline
|
double
|
||||||
double
|
|
||||||
second() const {
|
second() const {
|
||||||
return m_time.wMilliseconds * 0.001 + m_time.wSecond; }
|
return m_time.wMilliseconds * 0.001 + m_time.wSecond; }
|
||||||
inline
|
int
|
||||||
int
|
|
||||||
year_day() const {
|
year_day() const {
|
||||||
return m_yearday; }
|
return m_yearday; }
|
||||||
int
|
int
|
||||||
julian_day() const;
|
julian_day() const;
|
||||||
inline
|
double
|
||||||
double
|
|
||||||
zone_bias() const {
|
zone_bias() const {
|
||||||
return m_timezonebias; }
|
return m_timezonebias; }
|
||||||
void
|
void
|
||||||
@@ -56,22 +51,22 @@ private:
|
|||||||
convert_transition_time( SYSTEMTIME &Time ) const;
|
convert_transition_time( SYSTEMTIME &Time ) const;
|
||||||
// calculates day and month from given day of year
|
// calculates day and month from given day of year
|
||||||
void
|
void
|
||||||
daymonth( WORD &Day, WORD &Month, WORD const Year, WORD const Yearday );
|
daymonth( WORD &Day, WORD &Month, WORD Year, WORD Yearday );
|
||||||
// calculates day of year from given date
|
// calculates day of year from given date
|
||||||
int
|
int
|
||||||
year_day( int Day, int const Month, int const Year ) const;
|
year_day( int Day, int Month, int Year ) const;
|
||||||
// calculates day of week for provided date
|
// calculates day of week for provided date
|
||||||
int
|
int
|
||||||
day_of_week( int const Day, int const Month, int const Year ) const;
|
day_of_week( int Day, int Month, int Year ) const;
|
||||||
// calculates day of month for specified weekday of specified month of the year
|
// calculates day of month for specified weekday of specified month of the year
|
||||||
int
|
int
|
||||||
day_of_month( int const Week, int const Weekday, int const Month, int const Year ) const;
|
day_of_month( int Week, int Weekday, int Month, int Year ) const;
|
||||||
// returns number of days between specified days of week
|
// returns number of days between specified days of week
|
||||||
int
|
int
|
||||||
weekdays( int const First, int const Second ) const;
|
weekdays( int First, int Second ) const;
|
||||||
// returns true if specified year is a leap year, false otherwise
|
// returns true if specified year is a leap year, false otherwise
|
||||||
bool
|
bool
|
||||||
is_leap( int const Year ) const;
|
is_leap( int Year ) const;
|
||||||
|
|
||||||
SYSTEMTIME m_time;
|
SYSTEMTIME m_time;
|
||||||
double m_milliseconds{ 0.0 };
|
double m_milliseconds{ 0.0 };
|
||||||
|
|||||||
@@ -109,11 +109,11 @@ class float4
|
|||||||
z = c;
|
z = c;
|
||||||
w = d;
|
w = d;
|
||||||
};
|
};
|
||||||
float inline LengthSquared() const
|
float LengthSquared() const
|
||||||
{
|
{
|
||||||
return x * x + y * y + z * z + w * w;
|
return x * x + y * y + z * z + w * w;
|
||||||
};
|
};
|
||||||
float inline Length() const
|
float Length() const
|
||||||
{
|
{
|
||||||
return sqrt(x * x + y * y + z * z + w * w);
|
return sqrt(x * x + y * y + z * z + w * w);
|
||||||
};
|
};
|
||||||
@@ -246,8 +246,8 @@ public:
|
|||||||
e[i + 2] = f; // zamiana Y i Z
|
e[i + 2] = f; // zamiana Y i Z
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
inline float4x4 &Rotation(float const angle, float3 const &axis);
|
inline float4x4 &Rotation(float angle, float3 const &axis);
|
||||||
inline bool IdentityIs()
|
bool IdentityIs()
|
||||||
{ // sprawdzenie jednostkowości
|
{ // sprawdzenie jednostkowości
|
||||||
for (int i = 0; i < 16; ++i)
|
for (int i = 0; i < 16; ++i)
|
||||||
if (e[i] != (i % 5 ? 0.0 : 1.0)) // jedynki tylko na 0, 5, 10 i 15
|
if (e[i] != (i % 5 ? 0.0 : 1.0)) // jedynki tylko na 0, 5, 10 i 15
|
||||||
@@ -255,7 +255,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void Quaternion(float4 *q);
|
void Quaternion(float4 *q);
|
||||||
inline float3 *TranslationGet()
|
float3 *TranslationGet()
|
||||||
{
|
{
|
||||||
return (float3 *)(e + 12);
|
return (float3 *)(e + 12);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,13 +359,13 @@ struct global_settings {
|
|||||||
bool ConfigParseNetwork(cParser& Parser, const std::string& token);
|
bool ConfigParseNetwork(cParser& Parser, const std::string& token);
|
||||||
bool ConfigParseHardware(cParser& Parser, const std::string& token);
|
bool ConfigParseHardware(cParser& Parser, const std::string& token);
|
||||||
bool ConfigParseDebug(cParser& Parser, const std::string& token);
|
bool ConfigParseDebug(cParser& Parser, const std::string& token);
|
||||||
bool ConfigParse_gfx( cParser &parser, std::string_view const Token );
|
bool ConfigParse_gfx( cParser &parser, std::string_view Token );
|
||||||
// sends basic content of the class in legacy (text) format to provided stream
|
// sends basic content of the class in legacy (text) format to provided stream
|
||||||
void
|
void
|
||||||
export_as_text( std::ostream &Output ) const;
|
export_as_text( std::ostream &Output ) const;
|
||||||
template <typename Type_>
|
template <typename Type_>
|
||||||
void
|
void
|
||||||
export_as_text( std::ostream &Output, std::string const Key, Type_ const &Value ) const;
|
export_as_text( std::ostream &Output, std::string Key, Type_ const &Value ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Type_>
|
template <typename Type_>
|
||||||
@@ -377,11 +377,11 @@ global_settings::export_as_text( std::ostream &Output, std::string const Key, Ty
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
void
|
void
|
||||||
global_settings::export_as_text( std::ostream &Output, std::string const Key, std::string const &Value ) const;
|
global_settings::export_as_text( std::ostream &Output, std::string Key, std::string const &Value ) const;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void
|
void
|
||||||
global_settings::export_as_text( std::ostream &Output, std::string const Key, bool const &Value ) const;
|
global_settings::export_as_text( std::ostream &Output, std::string Key, bool const &Value ) const;
|
||||||
|
|
||||||
extern global_settings& GetGlobalSettings();
|
extern global_settings& GetGlobalSettings();
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ enum class logtype : unsigned int {
|
|||||||
powergrid = 1 << 10,
|
powergrid = 1 << 10,
|
||||||
};
|
};
|
||||||
void LogService();
|
void LogService();
|
||||||
void WriteLog( const char *str, logtype const Type = logtype::generic, bool isError = false );
|
void WriteLog( const char *str, logtype Type = logtype::generic, bool isError = false );
|
||||||
void Error( const std::string &asMessage, bool box = false );
|
void Error( const std::string &asMessage, bool box = false );
|
||||||
void Error( const char* &asMessage, bool box = false );
|
void Error( const char* &asMessage, bool box = false );
|
||||||
void ErrorLog( const std::string &str, logtype const Type = logtype::generic );
|
void ErrorLog( const std::string &str, logtype Type = logtype::generic );
|
||||||
void WriteLog( const std::string &str, logtype const Type = logtype::generic );
|
void WriteLog( const std::string &str, logtype Type = logtype::generic );
|
||||||
void CommLog( const char *str );
|
void CommLog( const char *str );
|
||||||
void CommLog( const std::string &str );
|
void CommLog( const std::string &str );
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ struct dictionary_source {
|
|||||||
dictionary_source() = default;
|
dictionary_source() = default;
|
||||||
dictionary_source( std::string const &Input );
|
dictionary_source( std::string const &Input );
|
||||||
// methods
|
// methods
|
||||||
inline void insert( std::string const &Key, double const Value ) { floats.emplace_back( Key, Value ); }
|
void insert( std::string const &Key, double const Value ) { floats.emplace_back( Key, Value ); }
|
||||||
inline void insert( std::string const &Key, int const Value ) { integers.emplace_back( Key, Value ); }
|
void insert( std::string const &Key, int const Value ) { integers.emplace_back( Key, Value ); }
|
||||||
inline void insert( std::string const &Key, bool const Value ) { bools.emplace_back( Key, Value ); }
|
void insert( std::string const &Key, bool const Value ) { bools.emplace_back( Key, Value ); }
|
||||||
inline void insert( std::string const &Key, std::string const Value ) { strings.emplace_back( Key, Value ); }
|
void insert( std::string const &Key, std::string const Value ) { strings.emplace_back( Key, Value ); }
|
||||||
inline void insert( std::string const &Key, std::vector<glm::vec2> const Value ) { vec2_lists.emplace_back( Key, Value ); }
|
void insert( std::string const &Key, std::vector<glm::vec2> const Value ) { vec2_lists.emplace_back( Key, Value ); }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ inline glm::dmat4 BasisChange(glm::dvec3 v, glm::dvec3 n)
|
|||||||
return BasisChange(u, v, n);
|
return BasisChange(u, v, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> inline glm::vec<3, T> RotateY(const glm::vec<3, T> &v, T angle)
|
template <typename T> glm::vec<3, T> RotateY(const glm::vec<3, T> &v, T angle)
|
||||||
{
|
{
|
||||||
T s = std::sin(angle);
|
T s = std::sin(angle);
|
||||||
T c = std::cos(angle);
|
T c = std::cos(angle);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline std::array<bool, 256> makeBreakTable(const char *brk)
|
std::array<bool, 256> makeBreakTable(const char *brk)
|
||||||
{
|
{
|
||||||
std::array<bool, 256> arr{};
|
std::array<bool, 256> arr{};
|
||||||
for (const unsigned char c : std::string_view(brk ? brk : ""))
|
for (const unsigned char c : std::string_view(brk ? brk : ""))
|
||||||
@@ -34,7 +34,7 @@ inline std::array<bool, 256> makeBreakTable(const char *brk)
|
|||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char toLowerChar(char c)
|
char toLowerChar(char c)
|
||||||
{
|
{
|
||||||
// Only fold ASCII letters. Bytes >= 0x80 belong to multibyte UTF-8
|
// Only fold ASCII letters. Bytes >= 0x80 belong to multibyte UTF-8
|
||||||
// sequences and must be passed through untouched, otherwise a non-"C"
|
// sequences and must be passed through untouched, otherwise a non-"C"
|
||||||
@@ -45,7 +45,7 @@ inline char toLowerChar(char c)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool startsWithBOM(const std::string &s)
|
bool startsWithBOM(const std::string &s)
|
||||||
{
|
{
|
||||||
return s.size() >= 3
|
return s.size() >= 3
|
||||||
&& static_cast<unsigned char>(s[0]) == 0xEF
|
&& static_cast<unsigned char>(s[0]) == 0xEF
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class cParser //: public std::stringstream
|
|||||||
buffer_TEXT
|
buffer_TEXT
|
||||||
};
|
};
|
||||||
// constructors:
|
// constructors:
|
||||||
cParser(std::string const &Stream, buffertype const Type = buffer_TEXT, std::string Path = "", bool const Loadtraction = true, std::vector<std::string> Parameters = std::vector<std::string>(), bool allowRandom = false );
|
cParser(std::string const &Stream, buffertype Type = buffer_TEXT, std::string Path = "", bool Loadtraction = true, std::vector<std::string> Parameters = std::vector<std::string>(), bool allowRandom = false );
|
||||||
// destructor:
|
// destructor:
|
||||||
virtual ~cParser();
|
virtual ~cParser();
|
||||||
// methods:
|
// methods:
|
||||||
@@ -42,29 +42,24 @@ class cParser //: public std::stringstream
|
|||||||
Output_ output;
|
Output_ output;
|
||||||
*this >> output;
|
*this >> output;
|
||||||
return output; };
|
return output; };
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
ignoreToken() {
|
ignoreToken() {
|
||||||
std::string out;
|
std::string out;
|
||||||
readToken(out); };
|
readToken(out); };
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
expectToken( std::string const &Value ) {
|
expectToken( std::string const &Value ) {
|
||||||
std::string out;
|
std::string out;
|
||||||
readToken(out);
|
readToken(out);
|
||||||
return out == Value; };
|
return out == Value; };
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
eof() {
|
eof() {
|
||||||
return mStream->eof(); };
|
return mStream->eof(); };
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
ok() {
|
ok() {
|
||||||
return !mStream->fail(); };
|
return !mStream->fail(); };
|
||||||
cParser &
|
cParser &
|
||||||
autoclear( bool const Autoclear );
|
autoclear( bool Autoclear );
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
autoclear() const {
|
autoclear() const {
|
||||||
return m_autoclear; }
|
return m_autoclear; }
|
||||||
bool
|
bool
|
||||||
@@ -74,8 +69,7 @@ class cParser //: public std::stringstream
|
|||||||
void substituteParameters(std::string &token, bool ToLower);
|
void substituteParameters(std::string &token, bool ToLower);
|
||||||
void skipIncludeBlock();
|
void skipIncludeBlock();
|
||||||
// returns next incoming token, if any, without removing it from the set
|
// returns next incoming token, if any, without removing it from the set
|
||||||
inline
|
std::string
|
||||||
std::string
|
|
||||||
peek() const {
|
peek() const {
|
||||||
return false == tokens.empty() ? tokens.front() : ""; }
|
return false == tokens.empty() ? tokens.front() : ""; }
|
||||||
// inject string as internal include
|
// inject string as internal include
|
||||||
@@ -104,7 +98,7 @@ class cParser //: public std::stringstream
|
|||||||
// methods:
|
// methods:
|
||||||
void readToken(std::string& out, bool ToLower = true, const char *Break = "\n\r\t ;");
|
void readToken(std::string& out, bool ToLower = true, const char *Break = "\n\r\t ;");
|
||||||
static std::vector<std::string> readParameters( cParser &Input );
|
static std::vector<std::string> readParameters( cParser &Input );
|
||||||
std::string readQuotes( char const Quote = '\"' );
|
std::string readQuotes( char Quote = '\"' );
|
||||||
void skipComment( std::string const &Endmark );
|
void skipComment( std::string const &Endmark );
|
||||||
bool findQuotes( std::string &String );
|
bool findQuotes( std::string &String );
|
||||||
bool trimComments( std::string &String );
|
bool trimComments( std::string &String );
|
||||||
@@ -131,7 +125,7 @@ class cParser //: public std::stringstream
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
glm::vec3
|
glm::vec3
|
||||||
cParser::getToken( bool const ToLower, const char *Break );
|
cParser::getToken( bool ToLower, const char *Break );
|
||||||
|
|
||||||
|
|
||||||
template<typename Type_>
|
template<typename Type_>
|
||||||
@@ -157,4 +151,4 @@ cParser::operator>>( bool &Right );
|
|||||||
|
|
||||||
template<>
|
template<>
|
||||||
bool
|
bool
|
||||||
cParser::getToken<bool>( bool const ToLower, const char *Break );
|
cParser::getToken<bool>( bool ToLower, const char *Break );
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ inline bool TestFlagAny(int const Flag, int const Value)
|
|||||||
{
|
{
|
||||||
return (Flag & Value) != 0;
|
return (Flag & Value) != 0;
|
||||||
}
|
}
|
||||||
bool SetFlag(int &Flag, int const Value);
|
bool SetFlag(int &Flag, int Value);
|
||||||
bool ClearFlag(int &Flag, int const Value);
|
bool ClearFlag(int &Flag, int Value);
|
||||||
|
|
||||||
bool FuzzyLogic(double Test, double Threshold, double Probability);
|
bool FuzzyLogic(double Test, double Threshold, double Probability);
|
||||||
/*jesli Test>Threshold to losowanie*/
|
/*jesli Test>Threshold to losowanie*/
|
||||||
@@ -124,11 +124,11 @@ std::pair<std::string, int> split_string_and_number(std::string const &Key);
|
|||||||
std::string to_string(int Value, int width);
|
std::string to_string(int Value, int width);
|
||||||
std::string to_string(double Value, int precision);
|
std::string to_string(double Value, int precision);
|
||||||
std::string to_string(double Value, int precision, int width);
|
std::string to_string(double Value, int precision, int width);
|
||||||
std::string to_hex_str(int const Value, int const width = 4);
|
std::string to_hex_str(int Value, int width = 4);
|
||||||
std::string to_minutes_str(float const Minutes, bool const Leadingzero, int const Width);
|
std::string to_minutes_str(float Minutes, bool Leadingzero, int Width);
|
||||||
|
|
||||||
template <std::same_as<bool> T> // Without this line this function can be used with other types implicit casted to boolean which may create hard to debug bugs.
|
template <std::same_as<bool> T> // Without this line this function can be used with other types implicit casted to boolean which may create hard to debug bugs.
|
||||||
inline std::string to_string(T Value)
|
std::string to_string(T Value)
|
||||||
{
|
{
|
||||||
return Value == true ? "true" : "false";
|
return Value == true ? "true" : "false";
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ std::string ToUpper(std::string const &text);
|
|||||||
// replaces polish letters with basic ascii
|
// replaces polish letters with basic ascii
|
||||||
void win1250_to_ascii(std::string &Input);
|
void win1250_to_ascii(std::string &Input);
|
||||||
// TODO: unify with win1250_to_ascii()
|
// TODO: unify with win1250_to_ascii()
|
||||||
std::string Bezogonkow(std::string Input, bool const Underscorestospaces = false);
|
std::string Bezogonkow(std::string Input, bool Underscorestospaces = false);
|
||||||
|
|
||||||
std::string win1250_to_utf8(const std::string &input);
|
std::string win1250_to_utf8(const std::string &input);
|
||||||
|
|
||||||
@@ -224,17 +224,17 @@ std::string substr_path(std::string const &Filename);
|
|||||||
std::ptrdiff_t len_common_prefix(std::string_view a, std::string_view b);
|
std::ptrdiff_t len_common_prefix(std::string_view a, std::string_view b);
|
||||||
|
|
||||||
// returns true if provided string contains another provided string
|
// returns true if provided string contains another provided string
|
||||||
bool contains(std::string_view const String, std::string_view Substring);
|
bool contains(std::string_view String, std::string_view Substring);
|
||||||
bool contains(std::string_view const String, char Character);
|
bool contains(std::string_view String, char Character);
|
||||||
|
|
||||||
// TODO: Ideally unique_ptr should be used instead of this (not safe) inline functions
|
// TODO: Ideally unique_ptr should be used instead of this (not safe) inline functions
|
||||||
template <typename T> inline void SafeDelete(T* &Pointer)
|
template <typename T> void SafeDelete(T* &Pointer)
|
||||||
{
|
{
|
||||||
delete Pointer;
|
delete Pointer;
|
||||||
Pointer = nullptr;
|
Pointer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> inline void SafeDeleteArray(T *&Pointer)
|
template <typename T> void SafeDeleteArray(T *&Pointer)
|
||||||
{
|
{
|
||||||
delete[] Pointer;
|
delete[] Pointer;
|
||||||
Pointer = nullptr;
|
Pointer = nullptr;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
static UID random() {
|
static UID random() {
|
||||||
static thread_local std::mt19937_64 gen(std::random_device{}());
|
thread_local std::mt19937_64 gen(std::random_device{}());
|
||||||
UID u;
|
UID u;
|
||||||
const uint64_t a = gen();
|
const uint64_t a = gen();
|
||||||
const uint64_t b = gen();
|
const uint64_t b = gen();
|
||||||
|
|||||||
@@ -29,19 +29,19 @@ public:
|
|||||||
///Loads info about coupler.
|
///Loads info about coupler.
|
||||||
void Load(cParser *Parser, TModel3d *Model);
|
void Load(cParser *Parser, TModel3d *Model);
|
||||||
int GetStatus();
|
int GetStatus();
|
||||||
inline void TurnOn() ///Turns on straight coupler.
|
void TurnOn() ///Turns on straight coupler.
|
||||||
{
|
{
|
||||||
On = true;
|
On = true;
|
||||||
xOn = false;
|
xOn = false;
|
||||||
Update();
|
Update();
|
||||||
};
|
};
|
||||||
inline void TurnOff() ///Turns on disconnected coupler.
|
void TurnOff() ///Turns on disconnected coupler.
|
||||||
{
|
{
|
||||||
On = false;
|
On = false;
|
||||||
xOn = false;
|
xOn = false;
|
||||||
Update();
|
Update();
|
||||||
};
|
};
|
||||||
inline void TurnxOn() ///Turns on slanted coupler.
|
void TurnxOn() ///Turns on slanted coupler.
|
||||||
{
|
{
|
||||||
On = false;
|
On = false;
|
||||||
xOn = true;
|
xOn = true;
|
||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// if the xOn model is missing, activate plain On instead
|
// if the xOn model is missing, activate plain On instead
|
||||||
inline void TurnxOnWithOnAsFallback()
|
void TurnxOnWithOnAsFallback()
|
||||||
{
|
{
|
||||||
if (ModelxOn != nullptr) {
|
if (ModelxOn != nullptr) {
|
||||||
On = false;
|
On = false;
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// if the xOn model is missing, activate plain Off instead
|
// if the xOn model is missing, activate plain Off instead
|
||||||
inline void TurnxOnWithOffAsFallback()
|
void TurnxOnWithOffAsFallback()
|
||||||
{
|
{
|
||||||
if (ModelxOn != nullptr) {
|
if (ModelxOn != nullptr) {
|
||||||
On = false;
|
On = false;
|
||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
TurnOff();
|
TurnOff();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
inline bool Active() const
|
bool Active() const
|
||||||
{
|
{
|
||||||
return ModelOn != nullptr || ModelxOn != nullptr;
|
return ModelOn != nullptr || ModelxOn != nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,25 +18,22 @@ class TButton {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
TButton() = default;
|
TButton() = default;
|
||||||
void Clear(int const i = -1);
|
void Clear(int i = -1);
|
||||||
inline
|
void FeedbackBitSet( int const i ) {
|
||||||
void FeedbackBitSet( int const i ) {
|
|
||||||
iFeedbackBit = 1 << i; };
|
iFeedbackBit = 1 << i; };
|
||||||
void Turn( bool const State );
|
void Turn( bool State );
|
||||||
inline
|
bool GetValue() const {
|
||||||
bool GetValue() const {
|
|
||||||
return m_state; }
|
return m_state; }
|
||||||
inline
|
bool Active() {
|
||||||
bool Active() {
|
|
||||||
return pModelOn != nullptr || pModelOff != nullptr; }
|
return pModelOn != nullptr || pModelOff != nullptr; }
|
||||||
void Update( bool const Power = true );
|
void Update( bool Power = true );
|
||||||
bool Init( std::string const &asName, TModel3d const *pModel, bool bNewOn = false );
|
bool Init( std::string const &asName, TModel3d const *pModel, bool bNewOn = false );
|
||||||
void Load( cParser &Parser, TDynamicObject const *Owner );
|
void Load( cParser &Parser, TDynamicObject const *Owner );
|
||||||
void AssignBool(bool const *bValue);
|
void AssignBool(bool const *bValue);
|
||||||
// returns offset of submodel associated with the button from the model centre
|
// returns offset of submodel associated with the button from the model centre
|
||||||
glm::vec3 model_offset() const;
|
glm::vec3 model_offset() const;
|
||||||
void gain(float new_volume);
|
void gain(float new_volume);
|
||||||
inline uint8_t b() { return m_state ? 1 : 0; };
|
uint8_t b() { return m_state ? 1 : 0; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// methods
|
// methods
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class TCamera {
|
|||||||
public: // McZapkie: potrzebuje do kiwania na boki
|
public: // McZapkie: potrzebuje do kiwania na boki
|
||||||
void Init(glm::dvec3 const &Location, glm::dvec3 const &Angle, TDynamicObject *Owner);
|
void Init(glm::dvec3 const &Location, glm::dvec3 const &Angle, TDynamicObject *Owner);
|
||||||
void Reset();
|
void Reset();
|
||||||
void OnCursorMove(double const x, double const y);
|
void OnCursorMove(double x, double y);
|
||||||
bool OnCommand( command_data const &Command );
|
bool OnCommand( command_data const &Command );
|
||||||
void Update();
|
void Update();
|
||||||
bool SetMatrix(glm::dmat4 &Matrix);
|
bool SetMatrix(glm::dmat4 &Matrix);
|
||||||
|
|||||||
120
vehicle/Driver.h
120
vehicle/Driver.h
@@ -172,8 +172,7 @@ class TSpeedPos
|
|||||||
void Clear();
|
void Clear();
|
||||||
bool Update();
|
bool Update();
|
||||||
// aktualizuje odległość we wpisie
|
// aktualizuje odległość we wpisie
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
UpdateDistance( double dist ) {
|
UpdateDistance( double dist ) {
|
||||||
fDist -= dist; }
|
fDist -= dist; }
|
||||||
bool Set(basic_event *e, double d, double length, TOrders order = Wait_for_orders);
|
bool Set(basic_event *e, double d, double length, TOrders order = Wait_for_orders);
|
||||||
@@ -221,48 +220,35 @@ public:
|
|||||||
public:
|
public:
|
||||||
void Update( double dt ); // uruchamiac przynajmniej raz na sekundę
|
void Update( double dt ); // uruchamiac przynajmniej raz na sekundę
|
||||||
void MoveTo( TDynamicObject *to );
|
void MoveTo( TDynamicObject *to );
|
||||||
void TakeControl( bool const Aidriver, bool const Forcevehiclecheck = false );
|
void TakeControl( bool Aidriver, bool Forcevehiclecheck = false );
|
||||||
inline
|
bool primary( bool const Primary ) {
|
||||||
bool primary( bool const Primary ) {
|
|
||||||
SetFlag( iDrivigFlags, Primary ? movePrimary : -movePrimary );
|
SetFlag( iDrivigFlags, Primary ? movePrimary : -movePrimary );
|
||||||
return primary(); }
|
return primary(); }
|
||||||
inline
|
bool primary() const {
|
||||||
bool primary() const {
|
|
||||||
return (iDrivigFlags & movePrimary) != 0; };
|
return (iDrivigFlags & movePrimary) != 0; };
|
||||||
inline
|
TMoverParameters const *Controlling() const {
|
||||||
TMoverParameters const *Controlling() const {
|
|
||||||
return mvControlling; }
|
return mvControlling; }
|
||||||
inline
|
TMoverParameters const *Occupied() const {
|
||||||
TMoverParameters const *Occupied() const {
|
|
||||||
return mvOccupied; }
|
return mvOccupied; }
|
||||||
void DirectionInitial();
|
void DirectionInitial();
|
||||||
void DirectionChange();
|
void DirectionChange();
|
||||||
inline
|
int Direction() const {
|
||||||
int Direction() const {
|
|
||||||
return iDirection; }
|
return iDirection; }
|
||||||
inline
|
TAction & action() {
|
||||||
TAction & action() {
|
|
||||||
return eAction; }
|
return eAction; }
|
||||||
inline
|
TAction const & action() const {
|
||||||
TAction const & action() const {
|
|
||||||
return eAction; }
|
return eAction; }
|
||||||
inline
|
bool is_active() const {
|
||||||
bool is_active() const {
|
|
||||||
return TestFlag( iDrivigFlags, moveActive ); }
|
return TestFlag( iDrivigFlags, moveActive ); }
|
||||||
inline
|
bool is_train() const {
|
||||||
bool is_train() const {
|
|
||||||
return TestFlag( mvOccupied->CategoryFlag, 1 ); }
|
return TestFlag( mvOccupied->CategoryFlag, 1 ); }
|
||||||
inline
|
bool is_car() const {
|
||||||
bool is_car() const {
|
|
||||||
return TestFlag( mvOccupied->CategoryFlag, 2 ); }
|
return TestFlag( mvOccupied->CategoryFlag, 2 ); }
|
||||||
inline
|
bool is_emu() const {
|
||||||
bool is_emu() const {
|
|
||||||
return mvControlling->TrainType == dt_EZT; }
|
return mvControlling->TrainType == dt_EZT; }
|
||||||
inline
|
bool is_dmu() const {
|
||||||
bool is_dmu() const {
|
|
||||||
return mvControlling->TrainType == dt_DMU; }
|
return mvControlling->TrainType == dt_DMU; }
|
||||||
inline
|
bool has_diesel_engine() const {
|
||||||
bool has_diesel_engine() const {
|
|
||||||
return mvControlling->EngineType == TEngineType::DieselElectric || mvControlling->EngineType == TEngineType::DieselEngine;
|
return mvControlling->EngineType == TEngineType::DieselElectric || mvControlling->EngineType == TEngineType::DieselEngine;
|
||||||
}
|
}
|
||||||
TBrakeSystem consist_brake_system() const;
|
TBrakeSystem consist_brake_system() const;
|
||||||
@@ -276,11 +262,11 @@ private:
|
|||||||
void ZeroLocalBrake();
|
void ZeroLocalBrake();
|
||||||
bool IncSpeed();
|
bool IncSpeed();
|
||||||
bool DecSpeed( bool force = false );
|
bool DecSpeed( bool force = false );
|
||||||
void ZeroSpeed( bool const Enforce = false );
|
void ZeroSpeed( bool Enforce = false );
|
||||||
bool IncBrakeEIM();
|
bool IncBrakeEIM();
|
||||||
bool DecBrakeEIM();
|
bool DecBrakeEIM();
|
||||||
bool IncSpeedEIM();
|
bool IncSpeedEIM();
|
||||||
bool DecSpeedEIM( int const Amount = 1 );
|
bool DecSpeedEIM( int Amount = 1 );
|
||||||
void BrakeLevelSet( double b );
|
void BrakeLevelSet( double b );
|
||||||
bool BrakeLevelAdd( double b );
|
bool BrakeLevelAdd( double b );
|
||||||
void SpeedSet();
|
void SpeedSet();
|
||||||
@@ -303,25 +289,23 @@ private:
|
|||||||
double BrakeAccFactor() const;
|
double BrakeAccFactor() const;
|
||||||
// modifies brake distance for low target speeds, to ease braking rate in such situations
|
// modifies brake distance for low target speeds, to ease braking rate in such situations
|
||||||
float
|
float
|
||||||
braking_distance_multiplier( float const Targetvelocity ) const;
|
braking_distance_multiplier( float Targetvelocity ) const;
|
||||||
inline
|
int DrivigFlags() const {
|
||||||
int DrivigFlags() const {
|
|
||||||
return iDrivigFlags; };
|
return iDrivigFlags; };
|
||||||
inline
|
double DirectionalVel() const {
|
||||||
double DirectionalVel() const {
|
|
||||||
return mvOccupied->Vel * sign( iDirection * mvOccupied->V ); }
|
return mvOccupied->Vel * sign( iDirection * mvOccupied->V ); }
|
||||||
|
|
||||||
void update_timers( double const dt );
|
void update_timers( double dt );
|
||||||
void update_logs( double const dt );
|
void update_logs( double dt );
|
||||||
void determine_consist_state();
|
void determine_consist_state();
|
||||||
void determine_braking_distance();
|
void determine_braking_distance();
|
||||||
void determine_proximity_ranges();
|
void determine_proximity_ranges();
|
||||||
void scan_route( double const Range );
|
void scan_route( double Range );
|
||||||
void scan_obstacles( double const Range );
|
void scan_obstacles( double Range );
|
||||||
void control_wheelslip();
|
void control_wheelslip();
|
||||||
void control_pantographs();
|
void control_pantographs();
|
||||||
void control_horns( double const Timedelta );
|
void control_horns( double Timedelta );
|
||||||
void control_security_system( double const Timedelta );
|
void control_security_system( double Timedelta );
|
||||||
void control_handles();
|
void control_handles();
|
||||||
void control_lights();
|
void control_lights();
|
||||||
void control_compartment_lights();
|
void control_compartment_lights();
|
||||||
@@ -334,15 +318,15 @@ private:
|
|||||||
void check_departure();
|
void check_departure();
|
||||||
void UpdateConnect();
|
void UpdateConnect();
|
||||||
void UpdateDisconnect();
|
void UpdateDisconnect();
|
||||||
int unit_count( int const Threshold ) const;
|
int unit_count( int Threshold ) const;
|
||||||
void UpdateChangeDirection();
|
void UpdateChangeDirection();
|
||||||
void UpdateLooseShunt();
|
void UpdateLooseShunt();
|
||||||
void UpdateObeyTrain();
|
void UpdateObeyTrain();
|
||||||
void GuardOpenDoor();
|
void GuardOpenDoor();
|
||||||
void pick_optimal_speed( double const Range );
|
void pick_optimal_speed( double Range );
|
||||||
void adjust_desired_speed_for_obstacles();
|
void adjust_desired_speed_for_obstacles();
|
||||||
void adjust_desired_speed_for_limits();
|
void adjust_desired_speed_for_limits();
|
||||||
void adjust_desired_speed_for_target_speed( double const Range );
|
void adjust_desired_speed_for_target_speed( double Range );
|
||||||
void adjust_desired_speed_for_current_speed();
|
void adjust_desired_speed_for_current_speed();
|
||||||
void adjust_desired_speed_for_braking_test();
|
void adjust_desired_speed_for_braking_test();
|
||||||
void control_tractive_and_braking_force();
|
void control_tractive_and_braking_force();
|
||||||
@@ -354,16 +338,16 @@ private:
|
|||||||
void increase_tractive_force();
|
void increase_tractive_force();
|
||||||
void control_braking_force();
|
void control_braking_force();
|
||||||
void apply_independent_brake_only();
|
void apply_independent_brake_only();
|
||||||
void check_route_ahead( double const Range );
|
void check_route_ahead( double Range );
|
||||||
void check_route_behind( double const Range );
|
void check_route_behind( double Range );
|
||||||
void UpdateBrakingHelper();
|
void UpdateBrakingHelper();
|
||||||
void hint( driver_hint const Value, hintpredicate const Predicate, float const Predicateparameter = 0.f );
|
void hint( driver_hint Value, hintpredicate Predicate, float Predicateparameter = 0.f );
|
||||||
void update_hints();
|
void update_hints();
|
||||||
void remove_hint( driver_hint const Value );
|
void remove_hint( driver_hint Value );
|
||||||
void remove_train_brake_hints();
|
void remove_train_brake_hints();
|
||||||
void remove_master_controller_hints();
|
void remove_master_controller_hints();
|
||||||
void remove_reverser_hints();
|
void remove_reverser_hints();
|
||||||
void cue_action( driver_hint const Action, float const Actionparameter = 0.f );
|
void cue_action( driver_hint Action, float Actionparameter = 0.f );
|
||||||
// members
|
// members
|
||||||
public:
|
public:
|
||||||
bool AIControllFlag = false; // rzeczywisty/wirtualny maszynista
|
bool AIControllFlag = false; // rzeczywisty/wirtualny maszynista
|
||||||
@@ -472,12 +456,12 @@ public:
|
|||||||
void PutCommand( std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation, TStopReason reason = stopComm );
|
void PutCommand( std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation, TStopReason reason = stopComm );
|
||||||
bool PutCommand( std::string NewCommand, double NewValue1, double NewValue2, glm::dvec3 const *NewLocation, TStopReason reason = stopComm );
|
bool PutCommand( std::string NewCommand, double NewValue1, double NewValue2, glm::dvec3 const *NewLocation, TStopReason reason = stopComm );
|
||||||
// defines assignment data
|
// defines assignment data
|
||||||
inline auto assignment() -> std::string & { return m_assignment; }
|
auto assignment() -> std::string & { return m_assignment; }
|
||||||
inline auto assignment() const -> std::string const & { return m_assignment; }
|
auto assignment() const -> std::string const & { return m_assignment; }
|
||||||
std::string OrderCurrent() const;
|
std::string OrderCurrent() const;
|
||||||
private:
|
private:
|
||||||
void RecognizeCommand(); // odczytuje komende przekazana lokomotywie
|
void RecognizeCommand(); // odczytuje komende przekazana lokomotywie
|
||||||
void JumpToNextOrder( bool const Skipmergedchangedirection = false );
|
void JumpToNextOrder( bool Skipmergedchangedirection = false );
|
||||||
void JumpToFirstOrder();
|
void JumpToFirstOrder();
|
||||||
void OrderPush( TOrders NewOrder );
|
void OrderPush( TOrders NewOrder );
|
||||||
void OrderNext( TOrders NewOrder );
|
void OrderNext( TOrders NewOrder );
|
||||||
@@ -486,7 +470,7 @@ private:
|
|||||||
void OrderCheck();
|
void OrderCheck();
|
||||||
void OrdersInit( double fVel );
|
void OrdersInit( double fVel );
|
||||||
void OrdersClear();
|
void OrdersClear();
|
||||||
void OrdersDump( std::string const Neworder, bool const Verbose = true );
|
void OrdersDump( std::string Neworder, bool Verbose = true );
|
||||||
std::string Order2Str( TOrders Order ) const;
|
std::string Order2Str( TOrders Order ) const;
|
||||||
// members
|
// members
|
||||||
std::string m_assignment;
|
std::string m_assignment;
|
||||||
@@ -499,39 +483,39 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
int CrossRoute( TTrack *tr );
|
int CrossRoute( TTrack *tr );
|
||||||
inline void MoveDistanceAdd( double distance ) {
|
void MoveDistanceAdd( double distance ) {
|
||||||
dMoveLen += distance * iDirection;
|
dMoveLen += distance * iDirection;
|
||||||
} //jak jedzie do tyłu to trzeba uwzględniać, że distance jest ujemna
|
} //jak jedzie do tyłu to trzeba uwzględniać, że distance jest ujemna
|
||||||
private:
|
private:
|
||||||
// Ra: metody obsługujące skanowanie toru
|
// Ra: metody obsługujące skanowanie toru
|
||||||
std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double const fDirection ) const;
|
std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double fDirection ) const;
|
||||||
bool TableAddNew();
|
bool TableAddNew();
|
||||||
bool TableNotFound( basic_event const *Event, double const Distance ) const;
|
bool TableNotFound( basic_event const *Event, double Distance ) const;
|
||||||
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
|
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
|
||||||
void TableCheck( double fDistance );
|
void TableCheck( double fDistance );
|
||||||
TCommandType TableUpdate( double &fVelDes, double &fDist, double &fNext, double &fAcc );
|
TCommandType TableUpdate( double &fVelDes, double &fDist, double &fNext, double &fAcc );
|
||||||
bool TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, double const Signaldistance );
|
bool TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, double Signaldistance );
|
||||||
bool TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPos &Point, double &Signaldistance, int const Pointindex );
|
bool TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPos &Point, double &Signaldistance, int Pointindex );
|
||||||
// returns most recently calculated distance to potential obstacle ahead
|
// returns most recently calculated distance to potential obstacle ahead
|
||||||
double TrackObstacle() const;
|
double TrackObstacle() const;
|
||||||
void TablePurger();
|
void TablePurger();
|
||||||
void TableSort();
|
void TableSort();
|
||||||
inline double MoveDistanceGet() const {
|
double MoveDistanceGet() const {
|
||||||
return dMoveLen;
|
return dMoveLen;
|
||||||
}
|
}
|
||||||
inline void MoveDistanceReset() {
|
void MoveDistanceReset() {
|
||||||
dMoveLen = 0.0;
|
dMoveLen = 0.0;
|
||||||
}
|
}
|
||||||
std::size_t TableSize() const { return sSpeedTable.size(); }
|
std::size_t TableSize() const { return sSpeedTable.size(); }
|
||||||
void TableClear();
|
void TableClear();
|
||||||
int TableDirection() { return iTableDirection; }
|
int TableDirection() { return iTableDirection; }
|
||||||
// Ra: stare funkcje skanujące, używane do szukania sygnalizatora z tyłu
|
// Ra: stare funkcje skanujące, używane do szukania sygnalizatora z tyłu
|
||||||
bool IsOccupiedByAnotherConsist( TTrack *Track, double const Distance );
|
bool IsOccupiedByAnotherConsist( TTrack *Track, double Distance );
|
||||||
basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int const Eventdirection = 1, end const End = rear );
|
basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int Eventdirection = 1, end End = rear );
|
||||||
TTrack *BackwardTraceRoute( double &fDistance, double &fDirection, TDynamicObject *Vehicle, basic_event *&Event, int const Eventdirection = 1, end const End = rear, bool const Untiloccupied = true );
|
TTrack *BackwardTraceRoute( double &fDistance, double &fDirection, TDynamicObject *Vehicle, basic_event *&Event, int Eventdirection = 1, end End = rear, bool Untiloccupied = true );
|
||||||
void SetProximityVelocity( double dist, double vel, glm::dvec3 const *pos );
|
void SetProximityVelocity( double dist, double vel, glm::dvec3 const *pos );
|
||||||
TCommandType BackwardScan( double const Range );
|
TCommandType BackwardScan( double Range );
|
||||||
std::string TableText( std::size_t const Index ) const;
|
std::string TableText( std::size_t Index ) const;
|
||||||
/*
|
/*
|
||||||
void RouteSwitch(int d);
|
void RouteSwitch(int d);
|
||||||
*/
|
*/
|
||||||
@@ -582,12 +566,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool PrepareEngine();
|
bool PrepareEngine();
|
||||||
bool ReleaseEngine();
|
bool ReleaseEngine();
|
||||||
void Doors( bool const Open, int const Side = 0 );
|
void Doors( bool Open, int Side = 0 );
|
||||||
// returns true if any vehicle in the consist has an open door
|
// returns true if any vehicle in the consist has an open door
|
||||||
bool doors_open() const;
|
bool doors_open() const;
|
||||||
bool doors_permit_active() const;
|
bool doors_permit_active() const;
|
||||||
void AutoRewident(); // ustawia hamulce w składzie
|
void AutoRewident(); // ustawia hamulce w składzie
|
||||||
void announce( announcement_t const Announcement );
|
void announce( announcement_t Announcement );
|
||||||
// members
|
// members
|
||||||
double fLength = 0.0; // długość składu (do wyciągania z ograniczeń)
|
double fLength = 0.0; // długość składu (do wyciągania z ograniczeń)
|
||||||
double fMass = 0.0; // całkowita masa do liczenia stycznej składowej grawitacji
|
double fMass = 0.0; // całkowita masa do liczenia stycznej składowej grawitacji
|
||||||
|
|||||||
115
vehicle/DynObj.h
115
vehicle/DynObj.h
@@ -217,12 +217,12 @@ public:
|
|||||||
std::string asDestination; // dokąd pojazd ma być kierowany "(stacja):(tor)"
|
std::string asDestination; // dokąd pojazd ma być kierowany "(stacja):(tor)"
|
||||||
glm::dmat4 mMatrix; // macierz przekształcenia do renderowania modeli
|
glm::dmat4 mMatrix; // macierz przekształcenia do renderowania modeli
|
||||||
TMoverParameters *MoverParameters; // parametry fizyki ruchu oraz przeliczanie
|
TMoverParameters *MoverParameters; // parametry fizyki ruchu oraz przeliczanie
|
||||||
inline TDynamicObject *NextConnected() { return MoverParameters->Neighbours[ rear ].vehicle; }; // pojazd podłączony od strony sprzęgu 1 (kabina -1)
|
TDynamicObject *NextConnected() { return MoverParameters->Neighbours[ rear ].vehicle; }; // pojazd podłączony od strony sprzęgu 1 (kabina -1)
|
||||||
inline TDynamicObject *PrevConnected() { return MoverParameters->Neighbours[ front ].vehicle; }; // pojazd podłączony od strony sprzęgu 0 (kabina 1)
|
TDynamicObject *PrevConnected() { return MoverParameters->Neighbours[ front ].vehicle; }; // pojazd podłączony od strony sprzęgu 0 (kabina 1)
|
||||||
inline TDynamicObject *NextConnected() const { return MoverParameters->Neighbours[ rear ].vehicle; }; // pojazd podłączony od strony sprzęgu 1 (kabina -1)
|
TDynamicObject *NextConnected() const { return MoverParameters->Neighbours[ rear ].vehicle; }; // pojazd podłączony od strony sprzęgu 1 (kabina -1)
|
||||||
inline TDynamicObject *PrevConnected() const { return MoverParameters->Neighbours[ front ].vehicle; }; // pojazd podłączony od strony sprzęgu 0 (kabina 1)
|
TDynamicObject *PrevConnected() const { return MoverParameters->Neighbours[ front ].vehicle; }; // pojazd podłączony od strony sprzęgu 0 (kabina 1)
|
||||||
inline int NextConnectedNo() const { return MoverParameters->Neighbours[ rear ].vehicle_end; }
|
int NextConnectedNo() const { return MoverParameters->Neighbours[ rear ].vehicle_end; }
|
||||||
inline int PrevConnectedNo() const { return MoverParameters->Neighbours[ front ].vehicle_end; }
|
int PrevConnectedNo() const { return MoverParameters->Neighbours[ front ].vehicle_end; }
|
||||||
|
|
||||||
// Dev tools
|
// Dev tools
|
||||||
void Reload();
|
void Reload();
|
||||||
@@ -272,8 +272,7 @@ private:
|
|||||||
material_data m_materialdata;
|
material_data m_materialdata;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline
|
material_data const
|
||||||
material_data const
|
|
||||||
*Material() const {
|
*Material() const {
|
||||||
return &m_materialdata; }
|
return &m_materialdata; }
|
||||||
// tymczasowo udostępnione do wyszukiwania drutu
|
// tymczasowo udostępnione do wyszukiwania drutu
|
||||||
@@ -436,8 +435,8 @@ private:
|
|||||||
sound_source rsEngageSlippery { sound_placement::engine }; // moved from cab
|
sound_source rsEngageSlippery { sound_placement::engine }; // moved from cab
|
||||||
sound_source retarder { sound_placement::engine };
|
sound_source retarder { sound_placement::engine };
|
||||||
|
|
||||||
void position( glm::vec3 const Location );
|
void position( glm::vec3 Location );
|
||||||
void render( TMoverParameters const &Vehicle, double const Deltatime );
|
void render( TMoverParameters const &Vehicle, double Deltatime );
|
||||||
};
|
};
|
||||||
// single source per door (pair) on the centreline
|
// single source per door (pair) on the centreline
|
||||||
struct doorspeaker_sounds {
|
struct doorspeaker_sounds {
|
||||||
@@ -464,7 +463,7 @@ private:
|
|||||||
void ABuModelRoll();
|
void ABuModelRoll();
|
||||||
void TurnOff();
|
void TurnOff();
|
||||||
// update state of load exchange operation
|
// update state of load exchange operation
|
||||||
void update_exchange( double const Deltatime );
|
void update_exchange( double Deltatime );
|
||||||
|
|
||||||
// members
|
// members
|
||||||
AirCoupler btCoupler1; // sprzegi
|
AirCoupler btCoupler1; // sprzegi
|
||||||
@@ -606,7 +605,7 @@ private:
|
|||||||
std::string asModel;
|
std::string asModel;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TDynamicObject *ABuFindObject( int &Foundcoupler, double &Distance, TTrack const *Track, int const Direction, int const Mycoupler ) const;
|
TDynamicObject *ABuFindObject( int &Foundcoupler, double &Distance, TTrack const *Track, int Direction, int Mycoupler ) const;
|
||||||
void ABuCheckMyTrack();
|
void ABuCheckMyTrack();
|
||||||
|
|
||||||
std::string rTypeName; // nazwa typu pojazdu
|
std::string rTypeName; // nazwa typu pojazdu
|
||||||
@@ -618,7 +617,7 @@ private:
|
|||||||
bool HeadlightsAoff{false}; // wygaszone swiatelki A
|
bool HeadlightsAoff{false}; // wygaszone swiatelki A
|
||||||
bool HeadlightsBoff{false}; // wygaszone swiatelki B
|
bool HeadlightsBoff{false}; // wygaszone swiatelki B
|
||||||
// checks whether there's unbroken connection of specified type to specified vehicle
|
// checks whether there's unbroken connection of specified type to specified vehicle
|
||||||
bool is_connected( TDynamicObject const *Vehicle, coupling const Coupling = coupler ) const;
|
bool is_connected( TDynamicObject const *Vehicle, coupling Coupling = coupler ) const;
|
||||||
TDynamicObject * PrevAny() const;
|
TDynamicObject * PrevAny() const;
|
||||||
TDynamicObject * Prev(int C = -1) const;
|
TDynamicObject * Prev(int C = -1) const;
|
||||||
TDynamicObject * Next(int C = -1) const;
|
TDynamicObject * Next(int C = -1) const;
|
||||||
@@ -670,15 +669,15 @@ private:
|
|||||||
std::string Name, std::string BaseDir, std::string asReplacableSkin, std::string Type_Name,
|
std::string Name, std::string BaseDir, std::string asReplacableSkin, std::string Type_Name,
|
||||||
TTrack *Track, double fDist, std::string DriverType, double fVel, std::string TrainName,
|
TTrack *Track, double fDist, std::string DriverType, double fVel, std::string TrainName,
|
||||||
float Load, std::string LoadType, bool Reversed, std::string);
|
float Load, std::string LoadType, bool Reversed, std::string);
|
||||||
int init_sections( TModel3d const *Model, std::string const &Nameprefix, bool const Overrideselfillum );
|
int init_sections( TModel3d const *Model, std::string const &Nameprefix, bool Overrideselfillum );
|
||||||
bool init_destination( TModel3d *Model );
|
bool init_destination( TModel3d *Model );
|
||||||
void create_controller( std::string const Type, bool const Trainset );
|
void create_controller( std::string Type, bool Trainset );
|
||||||
void AttachNext(TDynamicObject *Object, int iType = 1);
|
void AttachNext(TDynamicObject *Object, int iType = 1);
|
||||||
bool UpdateForce(double dt);
|
bool UpdateForce(double dt);
|
||||||
// initiates load change by specified amounts, with a platform on specified side
|
// initiates load change by specified amounts, with a platform on specified side
|
||||||
void LoadExchange( int const Disembark, int const Embark, int const Platforms );
|
void LoadExchange( int Disembark, int Embark, int Platforms );
|
||||||
// calculates time needed to complete current load change, using specified platforms
|
// calculates time needed to complete current load change, using specified platforms
|
||||||
float LoadExchangeTime( int const Platforms );
|
float LoadExchangeTime( int Platforms );
|
||||||
// calculates time needed to complete current load change, using previously specified platforms
|
// calculates time needed to complete current load change, using previously specified platforms
|
||||||
float LoadExchangeTime() const;
|
float LoadExchangeTime() const;
|
||||||
// calculates current load exchange factor, where 1 = nominal rate, higher = faster
|
// calculates current load exchange factor, where 1 = nominal rate, higher = faster
|
||||||
@@ -694,83 +693,83 @@ private:
|
|||||||
void Move(double fDistance);
|
void Move(double fDistance);
|
||||||
void FastMove(double fDistance);
|
void FastMove(double fDistance);
|
||||||
void RenderSounds();
|
void RenderSounds();
|
||||||
inline glm::dvec3 GetPosition() const {
|
glm::dvec3 GetPosition() const {
|
||||||
return vPosition; };
|
return vPosition; };
|
||||||
// converts location from vehicle coordinates frame to world frame
|
// converts location from vehicle coordinates frame to world frame
|
||||||
inline glm::dvec3 GetWorldPosition( glm::dvec3 const &Location ) const {
|
glm::dvec3 GetWorldPosition( glm::dvec3 const &Location ) const {
|
||||||
return vPosition + glm::dvec3(mMatrix * glm::dvec4(Location, 1.0)); }
|
return vPosition + glm::dvec3(mMatrix * glm::dvec4(Location, 1.0)); }
|
||||||
// pobranie współrzędnych czoła
|
// pobranie współrzędnych czoła
|
||||||
inline glm::dvec3 HeadPosition() const {
|
glm::dvec3 HeadPosition() const {
|
||||||
return vCoulpler[iDirection ^ 1]; };
|
return vCoulpler[iDirection ^ 1]; };
|
||||||
// pobranie współrzędnych tyłu
|
// pobranie współrzędnych tyłu
|
||||||
inline glm::dvec3 RearPosition() const {
|
glm::dvec3 RearPosition() const {
|
||||||
return vCoulpler[iDirection]; };
|
return vCoulpler[iDirection]; };
|
||||||
inline glm::dvec3 CouplerPosition( end const End ) const {
|
glm::dvec3 CouplerPosition( end const End ) const {
|
||||||
return vCoulpler[ End ]; }
|
return vCoulpler[ End ]; }
|
||||||
inline glm::dvec3 AxlePositionGet() {
|
glm::dvec3 AxlePositionGet() {
|
||||||
return iAxleFirst ?
|
return iAxleFirst ?
|
||||||
Axle1.pPosition :
|
Axle1.pPosition :
|
||||||
Axle0.pPosition; };
|
Axle0.pPosition; };
|
||||||
inline double Roll() {
|
double Roll() {
|
||||||
return Axle1.GetRoll() + Axle0.GetRoll(); }
|
return Axle1.GetRoll() + Axle0.GetRoll(); }
|
||||||
/*
|
/*
|
||||||
// TODO: check if scanning takes into account direction when selecting axle
|
// TODO: check if scanning takes into account direction when selecting axle
|
||||||
// if it does, replace the version above
|
// if it does, replace the version above
|
||||||
// if it doesn't, fix it so it does
|
// if it doesn't, fix it so it does
|
||||||
inline glm::dvec3 AxlePositionGet() {
|
inline glm::dvec3 AxlePositionGet() {
|
||||||
return (
|
return (
|
||||||
iDirection ?
|
iDirection ?
|
||||||
( iAxleFirst ? Axle1.pPosition : Axle0.pPosition ) :
|
( iAxleFirst ? Axle1.pPosition : Axle0.pPosition ) :
|
||||||
( iAxleFirst ? Axle0.pPosition : Axle1.pPosition ) ); }
|
( iAxleFirst ? Axle0.pPosition : Axle1.pPosition ) ); }
|
||||||
*/
|
*/
|
||||||
inline glm::dvec3 VectorFront() const {
|
glm::dvec3 VectorFront() const {
|
||||||
return vFront; };
|
return vFront; };
|
||||||
inline glm::dvec3 VectorUp() const {
|
glm::dvec3 VectorUp() const {
|
||||||
return vUp; };
|
return vUp; };
|
||||||
inline glm::dvec3 VectorLeft() const {
|
glm::dvec3 VectorLeft() const {
|
||||||
return vLeft; };
|
return vLeft; };
|
||||||
inline double const * Matrix() const {
|
double const * Matrix() const {
|
||||||
return glm::value_ptr(mMatrix); };
|
return glm::value_ptr(mMatrix); };
|
||||||
inline double * Matrix() {
|
double * Matrix() {
|
||||||
return glm::value_ptr(mMatrix); };
|
return glm::value_ptr(mMatrix); };
|
||||||
inline double GetVelocity() const {
|
double GetVelocity() const {
|
||||||
return MoverParameters->Vel; };
|
return MoverParameters->Vel; };
|
||||||
inline double GetLength() const {
|
double GetLength() const {
|
||||||
return MoverParameters->Dim.L; };
|
return MoverParameters->Dim.L; };
|
||||||
inline double GetWidth() const {
|
double GetWidth() const {
|
||||||
return MoverParameters->Dim.W; };
|
return MoverParameters->Dim.W; };
|
||||||
double radius() const;
|
double radius() const;
|
||||||
// calculates distance between event-starting axle and front of the vehicle
|
// calculates distance between event-starting axle and front of the vehicle
|
||||||
double tracing_offset() const;
|
double tracing_offset() const;
|
||||||
inline TTrack * GetTrack() {
|
TTrack * GetTrack() {
|
||||||
return iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack(); };
|
return iAxleFirst ? Axle1.GetTrack() : Axle0.GetTrack(); };
|
||||||
|
|
||||||
// McZapkie-260202
|
// McZapkie-260202
|
||||||
void LoadMMediaFile(std::string const &TypeName, std::string const &ReplacableSkin);
|
void LoadMMediaFile(std::string const &TypeName, std::string const &ReplacableSkin);
|
||||||
TModel3d *LoadMMediaFile_mdload( std::string const &Name ) const;
|
TModel3d *LoadMMediaFile_mdload( std::string const &Name ) const;
|
||||||
|
|
||||||
inline double ABuGetDirection() const { // ABu.
|
double ABuGetDirection() const { // ABu.
|
||||||
return Axle1.GetTrack() == MyTrack ? Axle1.GetDirection() : Axle0.GetDirection(); };
|
return Axle1.GetTrack() == MyTrack ? Axle1.GetDirection() : Axle0.GetDirection(); };
|
||||||
// zwraca kierunek pojazdu na torze z aktywną osą
|
// zwraca kierunek pojazdu na torze z aktywną osą
|
||||||
inline double RaDirectionGet() const {
|
double RaDirectionGet() const {
|
||||||
return iAxleFirst ?
|
return iAxleFirst ?
|
||||||
Axle1.GetDirection() :
|
Axle1.GetDirection() :
|
||||||
Axle0.GetDirection(); };
|
Axle0.GetDirection(); };
|
||||||
// zwraca przesunięcie wózka względem Point1 toru z aktywną osią
|
// zwraca przesunięcie wózka względem Point1 toru z aktywną osią
|
||||||
inline double RaTranslationGet() const {
|
double RaTranslationGet() const {
|
||||||
return iAxleFirst ?
|
return iAxleFirst ?
|
||||||
Axle1.GetTranslation() :
|
Axle1.GetTranslation() :
|
||||||
Axle0.GetTranslation(); };
|
Axle0.GetTranslation(); };
|
||||||
// zwraca tor z aktywną osią
|
// zwraca tor z aktywną osią
|
||||||
inline TTrack const * RaTrackGet() const {
|
TTrack const * RaTrackGet() const {
|
||||||
return iAxleFirst ?
|
return iAxleFirst ?
|
||||||
Axle1.GetTrack() :
|
Axle1.GetTrack() :
|
||||||
Axle0.GetTrack(); };
|
Axle0.GetTrack(); };
|
||||||
|
|
||||||
void couple( int const Side );
|
void couple( int Side );
|
||||||
int uncouple( int const Side );
|
int uncouple( int Side );
|
||||||
bool attach_coupler_adapter( int const Side, bool const Enforce = false );
|
bool attach_coupler_adapter( int Side, bool Enforce = false );
|
||||||
bool remove_coupler_adapter( int const Side );
|
bool remove_coupler_adapter( int Side );
|
||||||
void RadioStop();
|
void RadioStop();
|
||||||
void Damage(char flag);
|
void Damage(char flag);
|
||||||
void pants_up();
|
void pants_up();
|
||||||
@@ -781,8 +780,8 @@ private:
|
|||||||
bool has_signal_pc1_on() const;
|
bool has_signal_pc1_on() const;
|
||||||
bool has_signal_pc2_on() const;
|
bool has_signal_pc2_on() const;
|
||||||
bool has_signal_pc5_on() const;
|
bool has_signal_pc5_on() const;
|
||||||
bool has_signal_on( int const Side, int const Pattern ) const;
|
bool has_signal_on( int Side, int Pattern ) const;
|
||||||
void set_cab_lights( int const Cab, float const Level );
|
void set_cab_lights( int Cab, float Level );
|
||||||
TDynamicObject * FirstFind(int &coupler_nr, int cf = 1);
|
TDynamicObject * FirstFind(int &coupler_nr, int cf = 1);
|
||||||
float GetEPP(); // wyliczanie sredniego cisnienia w PG
|
float GetEPP(); // wyliczanie sredniego cisnienia w PG
|
||||||
int DirectionSet(int d); // ustawienie kierunku w składzie
|
int DirectionSet(int d); // ustawienie kierunku w składzie
|
||||||
@@ -795,14 +794,14 @@ private:
|
|||||||
// updates potential collision sources
|
// updates potential collision sources
|
||||||
void update_neighbours();
|
void update_neighbours();
|
||||||
// locates potential collision source within specified range, scanning its route in specified direction
|
// locates potential collision source within specified range, scanning its route in specified direction
|
||||||
auto find_vehicle( int const Direction, double const Range ) const -> std::tuple<TDynamicObject *, int, double, bool>;
|
auto find_vehicle( int Direction, double Range ) const -> std::tuple<TDynamicObject *, int, double, bool>;
|
||||||
// locates potential vehicle connected with specific coupling type and satisfying supplied predicate
|
// locates potential vehicle connected with specific coupling type and satisfying supplied predicate
|
||||||
template <typename Predicate_>
|
template <typename Predicate_>
|
||||||
auto find_vehicle( coupling const Coupling, Predicate_ const Predicate ) -> TDynamicObject *;
|
auto find_vehicle( coupling Coupling, Predicate_ Predicate ) -> TDynamicObject *;
|
||||||
TDynamicObject * FindPowered();
|
TDynamicObject * FindPowered();
|
||||||
TDynamicObject * FindPantographCarrier();
|
TDynamicObject * FindPantographCarrier();
|
||||||
template <typename UnaryFunction_>
|
template <typename UnaryFunction_>
|
||||||
void for_each( coupling const Coupling, UnaryFunction_ const Function );
|
void for_each( coupling Coupling, UnaryFunction_ Function );
|
||||||
void ParamSet(int what, int into);
|
void ParamSet(int what, int into);
|
||||||
// zapytanie do AI, po którym segmencie skrzyżowania jechać
|
// zapytanie do AI, po którym segmencie skrzyżowania jechać
|
||||||
int RouteWish(TTrack *tr);
|
int RouteWish(TTrack *tr);
|
||||||
@@ -812,7 +811,7 @@ private:
|
|||||||
glm::dvec3 get_future_movement() const;
|
glm::dvec3 get_future_movement() const;
|
||||||
void move_set(double distance);
|
void move_set(double distance);
|
||||||
// playes specified announcement, potentially preceding it with a chime
|
// playes specified announcement, potentially preceding it with a chime
|
||||||
void announce( announcement_t const Announcement, bool const Chime = true );
|
void announce( announcement_t Announcement, bool Chime = true );
|
||||||
// returns soundproofing for specified sound type and listener location
|
// returns soundproofing for specified sound type and listener location
|
||||||
float soundproofing( int const Placement, int const Listener ) const {
|
float soundproofing( int const Placement, int const Listener ) const {
|
||||||
return m_soundproofing[ Placement - 1 ][ Listener + 1 ]; }
|
return m_soundproofing[ Placement - 1 ][ Listener + 1 ]; }
|
||||||
@@ -829,7 +828,7 @@ private:
|
|||||||
// TBD, TODO: make an object out of it
|
// TBD, TODO: make an object out of it
|
||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void update_shake( double const Timedelta );
|
void update_shake( double Timedelta );
|
||||||
std::pair<double, double> shake_angles() const;
|
std::pair<double, double> shake_angles() const;
|
||||||
// members
|
// members
|
||||||
struct baseshake_config {
|
struct baseshake_config {
|
||||||
@@ -874,7 +873,7 @@ public:
|
|||||||
update_traction( TDynamicObject *Vehicle );
|
update_traction( TDynamicObject *Vehicle );
|
||||||
// legacy method, sends list of vehicles over network
|
// legacy method, sends list of vehicles over network
|
||||||
void
|
void
|
||||||
DynamicList( bool const Onlycontrolled = false ) const;
|
DynamicList( bool Onlycontrolled = false ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// maintenance; removes from tracks consists with vehicles marked as disabled
|
// maintenance; removes from tracks consists with vehicles marked as disabled
|
||||||
|
|||||||
@@ -38,17 +38,16 @@ public:
|
|||||||
TGauge() = default;
|
TGauge() = default;
|
||||||
explicit TGauge( sound_source const &Soundtemplate );
|
explicit TGauge( sound_source const &Soundtemplate );
|
||||||
|
|
||||||
inline
|
void Clear() {
|
||||||
void Clear() {
|
|
||||||
*this = TGauge(); }
|
*this = TGauge(); }
|
||||||
void Init(TSubModel *Submodel, TSubModel *Submodelon, TGaugeAnimation Type, float Scale = 1, float Offset = 0, float Friction = 0, float Value = 0, float const Endvalue = -1.0, float const Endscale = -1.0, bool const Interpolate = false );
|
void Init(TSubModel *Submodel, TSubModel *Submodelon, TGaugeAnimation Type, float Scale = 1, float Offset = 0, float Friction = 0, float Value = 0, float Endvalue = -1.0, float Endscale = -1.0, bool Interpolate = false );
|
||||||
void Load(cParser &Parser, TDynamicObject const *Owner, double const mul = 1.0);
|
void Load(cParser &Parser, TDynamicObject const *Owner, double mul = 1.0);
|
||||||
bool UpdateValue( float fNewDesired );
|
bool UpdateValue( float fNewDesired );
|
||||||
bool UpdateValue( float fNewDesired, std::optional<sound_source> &Fallbacksound );
|
bool UpdateValue( float fNewDesired, std::optional<sound_source> &Fallbacksound );
|
||||||
void PutValue(float fNewDesired);
|
void PutValue(float fNewDesired);
|
||||||
float GetValue() const;
|
float GetValue() const;
|
||||||
float GetDesiredValue() const;
|
float GetDesiredValue() const;
|
||||||
void Update( bool const Power = true );
|
void Update( bool Power = true );
|
||||||
void AssignFloat(float *fValue);
|
void AssignFloat(float *fValue);
|
||||||
void AssignDouble(double *dValue);
|
void AssignDouble(double *dValue);
|
||||||
void AssignInt(int *iValue);
|
void AssignInt(int *iValue);
|
||||||
@@ -58,11 +57,9 @@ public:
|
|||||||
// returns offset of submodel associated with the button from the model centre
|
// returns offset of submodel associated with the button from the model centre
|
||||||
glm::vec3 model_offset() const;
|
glm::vec3 model_offset() const;
|
||||||
TGaugeType type() const;
|
TGaugeType type() const;
|
||||||
inline
|
bool is_push() const {
|
||||||
bool is_push() const {
|
|
||||||
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::push ) ) != 0; }
|
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::push ) ) != 0; }
|
||||||
inline
|
bool is_toggle() const {
|
||||||
bool is_toggle() const {
|
|
||||||
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::toggle ) ) != 0; }
|
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::toggle ) ) != 0; }
|
||||||
bool is_delayed() const {
|
bool is_delayed() const {
|
||||||
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::delayed ) ) != 0; }
|
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::delayed ) ) != 0; }
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class TCab {
|
|||||||
public:
|
public:
|
||||||
// methods
|
// methods
|
||||||
void Load(cParser &Parser);
|
void Load(cParser &Parser);
|
||||||
void Update( bool const Power );
|
void Update( bool Power );
|
||||||
TGauge &Gauge( int n = -1 ); // pobranie adresu obiektu
|
TGauge &Gauge( int n = -1 ); // pobranie adresu obiektu
|
||||||
TButton &Button( int n = -1 ); // pobranie adresu obiektu
|
TButton &Button( int n = -1 ); // pobranie adresu obiektu
|
||||||
// members
|
// members
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
std::string
|
std::string
|
||||||
find( TSubModel const *Control ) const;
|
find( TSubModel const *Control ) const;
|
||||||
bool
|
bool
|
||||||
contains( std::string const Control ) const;
|
contains( std::string Control ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TTrain {
|
class TTrain {
|
||||||
@@ -153,30 +153,28 @@ class TTrain {
|
|||||||
// McZapkie-010302
|
// McZapkie-010302
|
||||||
bool Init(TDynamicObject *NewDynamicObject, bool e3d = false);
|
bool Init(TDynamicObject *NewDynamicObject, bool e3d = false);
|
||||||
|
|
||||||
inline glm::dvec3 GetDirection() const
|
glm::dvec3 GetDirection() const
|
||||||
{
|
{
|
||||||
return DynamicObject->VectorFront(); };
|
return DynamicObject->VectorFront(); };
|
||||||
inline glm::dvec3 GetUp() const
|
glm::dvec3 GetUp() const
|
||||||
{
|
{
|
||||||
return DynamicObject->VectorUp(); };
|
return DynamicObject->VectorUp(); };
|
||||||
inline
|
std::string GetLabel( TSubModel const *Control ) const {
|
||||||
std::string GetLabel( TSubModel const *Control ) const {
|
|
||||||
return m_controlmapper.find( Control ); }
|
return m_controlmapper.find( Control ); }
|
||||||
void UpdateCab();
|
void UpdateCab();
|
||||||
bool Update( double const Deltatime );
|
bool Update( double Deltatime );
|
||||||
void UpdateDirectionRelays();
|
void UpdateDirectionRelays();
|
||||||
void SetupDirectionRelays();
|
void SetupDirectionRelays();
|
||||||
bool prevBatState = false;
|
bool prevBatState = false;
|
||||||
int prevDirection = 0;
|
int prevDirection = 0;
|
||||||
void add_distance( double const Distance );
|
void add_distance( double Distance );
|
||||||
// McZapkie-310302: ladowanie parametrow z pliku
|
// McZapkie-310302: ladowanie parametrow z pliku
|
||||||
bool LoadMMediaFile(std::string const &asFileName);
|
bool LoadMMediaFile(std::string const &asFileName);
|
||||||
std::shared_ptr<dictionary_source> GetTrainState( dictionary_source const &Extraparameters );
|
std::shared_ptr<dictionary_source> GetTrainState( dictionary_source const &Extraparameters );
|
||||||
state_t get_state() const;
|
state_t get_state() const;
|
||||||
inline float get_radiovolume() const { return m_radiovolume; }
|
float get_radiovolume() const { return m_radiovolume; }
|
||||||
// basic_table interface
|
// basic_table interface
|
||||||
inline
|
std::string name() const {
|
||||||
std::string name() const {
|
|
||||||
return Dynamic()->name(); }
|
return Dynamic()->name(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -188,39 +186,37 @@ class TTrain {
|
|||||||
void clear_cab_controls();
|
void clear_cab_controls();
|
||||||
// sets cabin controls based on current state of the vehicle
|
// sets cabin controls based on current state of the vehicle
|
||||||
// NOTE: we can get rid of this function once we have per-cab persistent state
|
// NOTE: we can get rid of this function once we have per-cab persistent state
|
||||||
void set_cab_controls( int const Cab );
|
void set_cab_controls( int Cab );
|
||||||
// initializes a gauge matching provided label. returns: true if the label was found, false otherwise
|
// initializes a gauge matching provided label. returns: true if the label was found, false otherwise
|
||||||
bool initialize_gauge(cParser &Parser, std::string const &Label, int const Cabindex);
|
bool initialize_gauge(cParser &Parser, std::string const &Label, int Cabindex);
|
||||||
// initializes a button matching provided label. returns: true if the label was found, false otherwise
|
// initializes a button matching provided label. returns: true if the label was found, false otherwise
|
||||||
bool initialize_button(cParser &Parser, std::string const &Label, int const Cabindex);
|
bool initialize_button(cParser &Parser, std::string const &Label, int Cabindex);
|
||||||
// helper, returns true for EMU with oerlikon brake
|
// helper, returns true for EMU with oerlikon brake
|
||||||
bool is_eztoer() const;
|
bool is_eztoer() const;
|
||||||
// locates nearest vehicle belonging to the consist
|
// locates nearest vehicle belonging to the consist
|
||||||
TDynamicObject *find_nearest_consist_vehicle(bool freefly, glm::vec3 pos) const;
|
TDynamicObject *find_nearest_consist_vehicle(bool freefly, glm::vec3 pos) const;
|
||||||
// mover master controller to specified position
|
// mover master controller to specified position
|
||||||
void set_master_controller( double const Position );
|
void set_master_controller( double Position );
|
||||||
// moves train brake lever to specified position, potentially emits switch sound if conditions are met
|
// moves train brake lever to specified position, potentially emits switch sound if conditions are met
|
||||||
void set_train_brake( double const Position );
|
void set_train_brake( double Position );
|
||||||
// potentially moves train brake lever to neutral position
|
// potentially moves train brake lever to neutral position
|
||||||
void zero_charging_train_brake();
|
void zero_charging_train_brake();
|
||||||
// sets specified brake acting speed for specified vehicle, potentially updating state of cab controls to match
|
// sets specified brake acting speed for specified vehicle, potentially updating state of cab controls to match
|
||||||
void set_train_brake_speed( TDynamicObject *Vehicle, int const Speed );
|
void set_train_brake_speed( TDynamicObject *Vehicle, int Speed );
|
||||||
// sets the motor connector button in paired unit to specified state
|
// sets the motor connector button in paired unit to specified state
|
||||||
void set_paired_open_motor_connectors_button( bool const State );
|
void set_paired_open_motor_connectors_button( bool State );
|
||||||
// helper, common part of pantograph selection methods
|
// helper, common part of pantograph selection methods
|
||||||
void change_pantograph_selection( int const Change );
|
void change_pantograph_selection( int Change );
|
||||||
// helper, common part of pantograh valves state update methods
|
// helper, common part of pantograh valves state update methods
|
||||||
void update_pantograph_valves();
|
void update_pantograph_valves();
|
||||||
// update function subroutines
|
// update function subroutines
|
||||||
void update_sounds( double const Deltatime );
|
void update_sounds( double Deltatime );
|
||||||
void update_sounds_runningnoise( sound_source &Sound );
|
void update_sounds_runningnoise( sound_source &Sound );
|
||||||
void update_sounds_resonancenoise( sound_source &Sound );
|
void update_sounds_resonancenoise( sound_source &Sound );
|
||||||
void update_sounds_radio();
|
void update_sounds_radio();
|
||||||
inline
|
end cab_to_end( int const End ) const {
|
||||||
end cab_to_end( int const End ) const {
|
|
||||||
return End == 2 ? rear : front; }
|
return End == 2 ? rear : front; }
|
||||||
inline
|
end cab_to_end() const {
|
||||||
end cab_to_end() const {
|
|
||||||
return cab_to_end( iCabn ); }
|
return cab_to_end( iCabn ); }
|
||||||
void update_screens(double dt);
|
void update_screens(double dt);
|
||||||
|
|
||||||
@@ -922,19 +918,19 @@ private:
|
|||||||
float fDieselParams[9][10]; // parametry dla silnikow asynchronicznych
|
float fDieselParams[9][10]; // parametry dla silnikow asynchronicznych
|
||||||
// plays provided sound from position of the radio
|
// plays provided sound from position of the radio
|
||||||
bool radio_message_played;
|
bool radio_message_played;
|
||||||
void radio_message( sound_source *Message, int const Channel );
|
void radio_message( sound_source *Message, int Channel );
|
||||||
inline auto const RadioChannel() const { return Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1; }
|
auto const RadioChannel() const { return Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1; }
|
||||||
inline auto &RadioChannel() { return Dynamic()->Mechanik->iRadioChannel; }
|
auto &RadioChannel() { return Dynamic()->Mechanik->iRadioChannel; }
|
||||||
inline TDynamicObject *Dynamic() { return DynamicObject; };
|
TDynamicObject *Dynamic() { return DynamicObject; };
|
||||||
inline TDynamicObject const *Dynamic() const { return DynamicObject; };
|
TDynamicObject const *Dynamic() const { return DynamicObject; };
|
||||||
inline TMoverParameters *Controlled() { return mvControlled; };
|
TMoverParameters *Controlled() { return mvControlled; };
|
||||||
inline TMoverParameters const *Controlled() const { return mvControlled; };
|
TMoverParameters const *Controlled() const { return mvControlled; };
|
||||||
inline TMoverParameters *Occupied() { return mvOccupied; };
|
TMoverParameters *Occupied() { return mvOccupied; };
|
||||||
inline TMoverParameters const *Occupied() const { return mvOccupied; };
|
TMoverParameters const *Occupied() const { return mvOccupied; };
|
||||||
void DynamicSet(TDynamicObject *d);
|
void DynamicSet(TDynamicObject *d);
|
||||||
void MoveToVehicle( TDynamicObject *target );
|
void MoveToVehicle( TDynamicObject *target );
|
||||||
// checks whether specified point is within boundaries of the active cab
|
// checks whether specified point is within boundaries of the active cab
|
||||||
bool point_inside(glm::dvec3 const Point) const;
|
bool point_inside(glm::dvec3 Point) const;
|
||||||
glm::dvec3 clamp_inside(glm::dvec3 const &Point) const;
|
glm::dvec3 clamp_inside(glm::dvec3 const &Point) const;
|
||||||
const screenentry_sequence & get_screens();
|
const screenentry_sequence & get_screens();
|
||||||
|
|
||||||
@@ -946,7 +942,7 @@ class train_table : public basic_table<TTrain> {
|
|||||||
public:
|
public:
|
||||||
void update( double dt );
|
void update( double dt );
|
||||||
void updateAsync( double dt );
|
void updateAsync( double dt );
|
||||||
TTrain *find_id( std::uint16_t const Id ) const;
|
TTrain *find_id( std::uint16_t Id ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class vehicleparams_panel : public ui_panel
|
|||||||
command_relay m_relay;
|
command_relay m_relay;
|
||||||
texture_handle vehicle_mini;
|
texture_handle vehicle_mini;
|
||||||
|
|
||||||
void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), const ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
|
void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
|
||||||
void draw_mini(const TMoverParameters &mover);
|
void draw_mini(const TMoverParameters &mover);
|
||||||
public:
|
public:
|
||||||
vehicleparams_panel(const std::string &vehicle);
|
vehicleparams_panel(const std::string &vehicle);
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ public:
|
|||||||
bool check_activation();
|
bool check_activation();
|
||||||
// checks conditions associated with the event. returns: true if the conditions are met
|
// checks conditions associated with the event. returns: true if the conditions are met
|
||||||
bool check_conditions();
|
bool check_conditions();
|
||||||
inline
|
auto key() const {
|
||||||
auto key() const {
|
|
||||||
return iKey; }
|
return iKey; }
|
||||||
bool IsGlobal() const;
|
bool IsGlobal() const;
|
||||||
bool IsRadioActivated() const;
|
bool IsRadioActivated() const;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ protected:
|
|||||||
};
|
};
|
||||||
// methods
|
// methods
|
||||||
template <class TableType_>
|
template <class TableType_>
|
||||||
void init_targets( TableType_ &Repository, std::string const &Targettype, bool const Logerrors = true );
|
void init_targets( TableType_ &Repository, std::string const &Targettype, bool Logerrors = true );
|
||||||
// returns true if provided token is a an event desription keyword, false otherwise
|
// returns true if provided token is a an event desription keyword, false otherwise
|
||||||
static bool is_keyword( std::string const &Token );
|
static bool is_keyword( std::string const &Token );
|
||||||
|
|
||||||
@@ -648,7 +648,7 @@ public:
|
|||||||
queue( TEventLauncher *Launcher );
|
queue( TEventLauncher *Launcher );
|
||||||
// inserts in the event query events assigned to event launchers capable of receiving specified radio message sent from specified location
|
// inserts in the event query events assigned to event launchers capable of receiving specified radio message sent from specified location
|
||||||
void
|
void
|
||||||
queue_receivers( radio_message const Message, glm::dvec3 const &Location );
|
queue_receivers( radio_message Message, glm::dvec3 const &Location );
|
||||||
// legacy method, updates event queues
|
// legacy method, updates event queues
|
||||||
void
|
void
|
||||||
update();
|
update();
|
||||||
@@ -656,16 +656,14 @@ public:
|
|||||||
// TBD, TODO: return handle to the event
|
// TBD, TODO: return handle to the event
|
||||||
bool
|
bool
|
||||||
insert( basic_event *Event );
|
insert( basic_event *Event );
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
insert( TEventLauncher *Launcher ) {
|
insert( TEventLauncher *Launcher ) {
|
||||||
return Launcher->IsRadioActivated() ? m_radiodrivenlaunchers.insert(Launcher) : m_inputdrivenlaunchers.insert(Launcher); }
|
return Launcher->IsRadioActivated() ? m_radiodrivenlaunchers.insert(Launcher) : m_inputdrivenlaunchers.insert(Launcher); }
|
||||||
inline void purge (TEventLauncher *Launcher) {
|
void purge (TEventLauncher *Launcher) {
|
||||||
m_radiodrivenlaunchers.purge(Launcher);
|
m_radiodrivenlaunchers.purge(Launcher);
|
||||||
m_inputdrivenlaunchers.purge(Launcher); }
|
m_inputdrivenlaunchers.purge(Launcher); }
|
||||||
// returns first event in the queue
|
// returns first event in the queue
|
||||||
inline
|
basic_event *
|
||||||
basic_event *
|
|
||||||
begin() {
|
begin() {
|
||||||
return QueryRootEvent; }
|
return QueryRootEvent; }
|
||||||
|
|
||||||
@@ -677,7 +675,7 @@ public:
|
|||||||
// legacy method, returns pointer to specified event, or null
|
// legacy method, returns pointer to specified event, or null
|
||||||
basic_event *
|
basic_event *
|
||||||
FindEvent( std::string const &Name );
|
FindEvent( std::string const &Name );
|
||||||
inline TEventLauncher* FindEventlauncher(std::string const &Name) {
|
TEventLauncher * FindEventlauncher(std::string const &Name) {
|
||||||
const auto ptr = m_inputdrivenlaunchers.find(Name);
|
const auto ptr = m_inputdrivenlaunchers.find(Name);
|
||||||
return ptr ? ptr : m_radiodrivenlaunchers.find(Name);
|
return ptr ? ptr : m_radiodrivenlaunchers.find(Name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ public:
|
|||||||
explicit TMemCell( scene::node_data const &Nodedata );
|
explicit TMemCell( scene::node_data const &Nodedata );
|
||||||
// methods
|
// methods
|
||||||
void
|
void
|
||||||
UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
|
UpdateValues( std::string const &szNewText, double fNewValue1, double fNewValue2, int CheckMask );
|
||||||
bool
|
bool
|
||||||
Load(cParser *parser);
|
Load(cParser *parser);
|
||||||
void
|
void
|
||||||
PutCommand( TController *Mech, glm::dvec3 const *Loc ) const;
|
PutCommand( TController *Mech, glm::dvec3 const *Loc ) const;
|
||||||
bool
|
bool
|
||||||
Compare( std::string const &szTestText, double const fTestValue1, double const fTestValue2, int const CheckMask,
|
Compare( std::string const &szTestText, double fTestValue1, double fTestValue2, int CheckMask,
|
||||||
comparison_operator const TextOperator = comparison_operator::equal,
|
comparison_operator TextOperator = comparison_operator::equal,
|
||||||
comparison_operator const Value1Operator = comparison_operator::equal,
|
comparison_operator Value1Operator = comparison_operator::equal,
|
||||||
comparison_operator const Value2Operator = comparison_operator::equal,
|
comparison_operator Value2Operator = comparison_operator::equal,
|
||||||
comparison_pass const Pass = comparison_pass::all ) const;
|
comparison_pass Pass = comparison_pass::all ) const;
|
||||||
std::string const &
|
std::string const &
|
||||||
Text() const {
|
Text() const {
|
||||||
return szText; }
|
return szText; }
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ class TSegment
|
|||||||
glm::dvec3 vA, vB, vC; // współczynniki wielomianów trzeciego stopnia vD==Point1
|
glm::dvec3 vA, vB, vC; // współczynniki wielomianów trzeciego stopnia vD==Point1
|
||||||
TTrack *pOwner = nullptr; // wskaźnik na właściciela
|
TTrack *pOwner = nullptr; // wskaźnik na właściciela
|
||||||
|
|
||||||
glm::dvec3 GetFirstDerivative(double const fTime) const;
|
glm::dvec3 GetFirstDerivative(double fTime) const;
|
||||||
double RombergIntegral(double const fA, double const fB) const;
|
double RombergIntegral(double fA, double fB) const;
|
||||||
double GetTFromS(double const s) const;
|
double GetTFromS(double s) const;
|
||||||
glm::dvec3 RaInterpolate(double const t) const;
|
glm::dvec3 RaInterpolate(double t) const;
|
||||||
glm::dvec3 RaInterpolate0(double const t) const;
|
glm::dvec3 RaInterpolate0(double t) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool bCurve = false;
|
bool bCurve = false;
|
||||||
@@ -71,22 +71,19 @@ public:
|
|||||||
// finds point on segment closest to specified point in 3d space. returns: point on segment as value in range 0-1
|
// finds point on segment closest to specified point in 3d space. returns: point on segment as value in range 0-1
|
||||||
double
|
double
|
||||||
find_nearest_point( glm::dvec3 const &Point ) const;
|
find_nearest_point( glm::dvec3 const &Point ) const;
|
||||||
inline
|
glm::dvec3
|
||||||
glm::dvec3
|
|
||||||
GetDirection1() const {
|
GetDirection1() const {
|
||||||
return bCurve ? CPointOut - Point1 : CPointOut; };
|
return bCurve ? CPointOut - Point1 : CPointOut; };
|
||||||
inline
|
glm::dvec3
|
||||||
glm::dvec3
|
|
||||||
GetDirection2() const {
|
GetDirection2() const {
|
||||||
return bCurve ? CPointIn - Point2 : CPointIn; };
|
return bCurve ? CPointIn - Point2 : CPointIn; };
|
||||||
glm::dvec3
|
glm::dvec3
|
||||||
GetDirection(double const fDistance) const;
|
GetDirection(double fDistance) const;
|
||||||
inline
|
glm::dvec3
|
||||||
glm::dvec3
|
|
||||||
GetDirection() const {
|
GetDirection() const {
|
||||||
return CPointOut; };
|
return CPointOut; };
|
||||||
glm::dvec3
|
glm::dvec3
|
||||||
FastGetDirection(double const fDistance, double const fOffset);
|
FastGetDirection(double fDistance, double fOffset);
|
||||||
/*
|
/*
|
||||||
Math3D::vector3
|
Math3D::vector3
|
||||||
GetPoint(double const fDistance) const;
|
GetPoint(double const fDistance) const;
|
||||||
@@ -98,39 +95,33 @@ public:
|
|||||||
/// <param name="fDistance">Distance from p1</param>
|
/// <param name="fDistance">Distance from p1</param>
|
||||||
/// <param name="position">Calculated position</param>
|
/// <param name="position">Calculated position</param>
|
||||||
/// <param name="rotation">Calculated rotation</param>
|
/// <param name="rotation">Calculated rotation</param>
|
||||||
void RaPositionGet(double const fDistance, glm::dvec3 &position, glm::vec3 &rotation) const;
|
void RaPositionGet(double fDistance, glm::dvec3 &position, glm::vec3 &rotation) const;
|
||||||
glm::dvec3 FastGetPoint(double const t) const;
|
glm::dvec3 FastGetPoint(double t) const;
|
||||||
inline
|
glm::dvec3
|
||||||
glm::dvec3
|
|
||||||
FastGetPoint_0() const {
|
FastGetPoint_0() const {
|
||||||
return Point1; };
|
return Point1; };
|
||||||
inline
|
glm::dvec3
|
||||||
glm::dvec3
|
|
||||||
FastGetPoint_1() const {
|
FastGetPoint_1() const {
|
||||||
return Point2; };
|
return Point2; };
|
||||||
inline
|
float
|
||||||
float
|
|
||||||
GetRoll(double const Distance) const {
|
GetRoll(double const Distance) const {
|
||||||
return std::lerp( fRoll1, fRoll2, static_cast<float>(Distance / fLength) ); }
|
return std::lerp( fRoll1, fRoll2, static_cast<float>(Distance / fLength) ); }
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
GetRolls(float &r1, float &r2) const {
|
GetRolls(float &r1, float &r2) const {
|
||||||
// pobranie przechyłek (do generowania trójkątów)
|
// pobranie przechyłek (do generowania trójkątów)
|
||||||
r1 = fRoll1;
|
r1 = fRoll1;
|
||||||
r2 = fRoll2; }
|
r2 = fRoll2; }
|
||||||
|
|
||||||
bool
|
bool
|
||||||
RenderLoft( gfx::vertex_array &Output, glm::dvec3 const &Origin, gfx::vertex_array const &ShapePoints, bool const Transition, double fTextureLength, double Texturescale = 1.0, int iSkip = 0, int iEnd = 0, std::pair<float, float> fOffsetX = {0.f, 0.f}, glm::vec3 **p = nullptr, bool bRender = true );
|
RenderLoft( gfx::vertex_array &Output, glm::dvec3 const &Origin, gfx::vertex_array const &ShapePoints, bool Transition, double fTextureLength, double Texturescale = 1.0, int iSkip = 0, int iEnd = 0, std::pair<float, float> fOffsetX = {0.f, 0.f}, glm::vec3 **p = nullptr, bool bRender = true );
|
||||||
/*
|
/*
|
||||||
void
|
void
|
||||||
Render();
|
Render();
|
||||||
*/
|
*/
|
||||||
inline
|
double
|
||||||
double
|
|
||||||
GetLength() const {
|
GetLength() const {
|
||||||
return fLength; };
|
return fLength; };
|
||||||
inline
|
int
|
||||||
int
|
|
||||||
RaSegCount() const {
|
RaSegCount() const {
|
||||||
return fTsBuffer.empty() ? 1 : iSegCount; };
|
return fTsBuffer.empty() ? 1 : iSegCount; };
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class TTraction;
|
|||||||
class TSwitchExtension
|
class TSwitchExtension
|
||||||
{ // dodatkowe dane do toru, który jest zwrotnicą
|
{ // dodatkowe dane do toru, który jest zwrotnicą
|
||||||
public:
|
public:
|
||||||
TSwitchExtension(TTrack *owner, int const what);
|
TSwitchExtension(TTrack *owner, int what);
|
||||||
~TSwitchExtension();
|
~TSwitchExtension();
|
||||||
std::shared_ptr<TSegment> Segments[6]; // dwa tory od punktu 1, pozosta³e dwa od 2? Ra 140101: 6 po³¹czeñ dla skrzy¿owañ
|
std::shared_ptr<TSegment> Segments[6]; // dwa tory od punktu 1, pozosta³e dwa od 2? Ra 140101: 6 po³¹czeñ dla skrzy¿owañ
|
||||||
TTrack *pNexts[2]; // tory do³¹czone do punktów 2 i 4
|
TTrack *pNexts[2]; // tory do³¹czone do punktów 2 i 4
|
||||||
@@ -112,24 +112,19 @@ public:
|
|||||||
static TIsolated * Find(const std::string &n); // znalezienie obiektu albo utworzenie nowego
|
static TIsolated * Find(const std::string &n); // znalezienie obiektu albo utworzenie nowego
|
||||||
void AssignEvents();
|
void AssignEvents();
|
||||||
void Modify(int i, TDynamicObject *o); // dodanie lub odjęcie osi
|
void Modify(int i, TDynamicObject *o); // dodanie lub odjęcie osi
|
||||||
inline
|
bool
|
||||||
bool
|
|
||||||
Busy() {
|
Busy() {
|
||||||
return iAxles > 0; };
|
return iAxles > 0; };
|
||||||
inline
|
static TIsolated *
|
||||||
static TIsolated *
|
|
||||||
Root() {
|
Root() {
|
||||||
return pRoot; };
|
return pRoot; };
|
||||||
inline
|
TIsolated *
|
||||||
TIsolated *
|
|
||||||
Next() {
|
Next() {
|
||||||
return pNext; };
|
return pNext; };
|
||||||
inline
|
void
|
||||||
void
|
|
||||||
parent( TIsolated *Parent ) {
|
parent( TIsolated *Parent ) {
|
||||||
pParent = Parent; }
|
pParent = Parent; }
|
||||||
inline
|
TIsolated *
|
||||||
TIsolated *
|
|
||||||
parent() const {
|
parent() const {
|
||||||
return pParent; }
|
return pParent; }
|
||||||
// members
|
// members
|
||||||
@@ -249,39 +244,38 @@ public:
|
|||||||
static bool sort_by_material( TTrack const *Left, TTrack const *Right );
|
static bool sort_by_material( TTrack const *Left, TTrack const *Right );
|
||||||
static TTrack * Create400m(int what, double dx);
|
static TTrack * Create400m(int what, double dx);
|
||||||
TTrack * NullCreate(int dir);
|
TTrack * NullCreate(int dir);
|
||||||
inline bool IsEmpty() {
|
bool IsEmpty() {
|
||||||
return Dynamics.empty(); };
|
return Dynamics.empty(); };
|
||||||
void ConnectPrevPrev(TTrack *pNewPrev, int typ);
|
void ConnectPrevPrev(TTrack *pNewPrev, int typ);
|
||||||
void ConnectPrevNext(TTrack *pNewPrev, int typ);
|
void ConnectPrevNext(TTrack *pNewPrev, int typ);
|
||||||
void ConnectNextPrev(TTrack *pNewNext, int typ);
|
void ConnectNextPrev(TTrack *pNewNext, int typ);
|
||||||
void ConnectNextNext(TTrack *pNewNext, int typ);
|
void ConnectNextNext(TTrack *pNewNext, int typ);
|
||||||
material_handle copy_adjacent_trackbed_material( TTrack const *Exclude = nullptr );
|
material_handle copy_adjacent_trackbed_material( TTrack const *Exclude = nullptr );
|
||||||
inline double Length() const {
|
double Length() const {
|
||||||
return Segment->GetLength(); };
|
return Segment->GetLength(); };
|
||||||
inline std::shared_ptr<TSegment> CurrentSegment() const {
|
std::shared_ptr<TSegment> CurrentSegment() const {
|
||||||
return Segment; };
|
return Segment; };
|
||||||
inline TTrack *CurrentNext() const {
|
TTrack *CurrentNext() const {
|
||||||
return trNext; };
|
return trNext; };
|
||||||
inline TTrack *CurrentPrev() const {
|
TTrack *CurrentPrev() const {
|
||||||
return trPrev; };
|
return trPrev; };
|
||||||
TTrack *Connected(int s, double &d) const;
|
TTrack *Connected(int s, double &d) const;
|
||||||
bool SetConnections(int i);
|
bool SetConnections(int i);
|
||||||
bool Switch(int i, float const t = -1.f, float const d = -1.f);
|
bool Switch(int i, float t = -1.f, float d = -1.f);
|
||||||
bool SwitchForced(int i, TDynamicObject *o);
|
bool SwitchForced(int i, TDynamicObject *o);
|
||||||
int CrossSegment(int from, int into);
|
int CrossSegment(int from, int into);
|
||||||
inline int GetSwitchState() {
|
int GetSwitchState() {
|
||||||
return SwitchExtension ? SwitchExtension->CurrentIndex : -1; };
|
return SwitchExtension ? SwitchExtension->CurrentIndex : -1; };
|
||||||
// returns number of different routes possible to take from given point
|
// returns number of different routes possible to take from given point
|
||||||
// TODO: specify entry point, number of routes for switches can vary
|
// TODO: specify entry point, number of routes for switches can vary
|
||||||
inline
|
int
|
||||||
int
|
|
||||||
RouteCount() const {
|
RouteCount() const {
|
||||||
return SwitchExtension != nullptr ? SwitchExtension->iRoads - 1 : 1; }
|
return SwitchExtension != nullptr ? SwitchExtension->iRoads - 1 : 1; }
|
||||||
void Load(cParser *parser, glm::dvec3 const &pOrigin);
|
void Load(cParser *parser, glm::dvec3 const &pOrigin);
|
||||||
bool AssignEvents();
|
bool AssignEvents();
|
||||||
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
|
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
|
||||||
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
|
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
|
||||||
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double const Delaylimit );
|
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
|
||||||
bool CheckDynamicObject(TDynamicObject *Dynamic);
|
bool CheckDynamicObject(TDynamicObject *Dynamic);
|
||||||
bool AddDynamicObject(TDynamicObject *Dynamic);
|
bool AddDynamicObject(TDynamicObject *Dynamic);
|
||||||
bool RemoveDynamicObject(TDynamicObject *Dynamic);
|
bool RemoveDynamicObject(TDynamicObject *Dynamic);
|
||||||
@@ -300,7 +294,7 @@ public:
|
|||||||
double ActiveLength();
|
double ActiveLength();
|
||||||
|
|
||||||
void create_geometry( gfx::geometrybank_handle const &Bank ); // wypełnianie VBO
|
void create_geometry( gfx::geometrybank_handle const &Bank ); // wypełnianie VBO
|
||||||
void create_map_geometry(std::vector<gfx::basic_vertex> &Bank, const gfx::geometrybank_handle Extra);
|
void create_map_geometry(std::vector<gfx::basic_vertex> &Bank, gfx::geometrybank_handle Extra);
|
||||||
void get_map_active_paths(map_colored_paths &handles);
|
void get_map_active_paths(map_colored_paths &handles);
|
||||||
void get_map_paths_for_state(map_colored_paths &handles, int state);
|
void get_map_paths_for_state(map_colored_paths &handles, int state);
|
||||||
void get_map_future_paths(map_colored_paths &handles);
|
void get_map_future_paths(map_colored_paths &handles);
|
||||||
@@ -325,7 +319,7 @@ public:
|
|||||||
double WidthTotal();
|
double WidthTotal();
|
||||||
bool IsGroupable();
|
bool IsGroupable();
|
||||||
int TestPoint(const glm::dvec3 *Point);
|
int TestPoint(const glm::dvec3 *Point);
|
||||||
void MovedUp1(float const dh);
|
void MovedUp1(float dh);
|
||||||
void VelocitySet(float v);
|
void VelocitySet(float v);
|
||||||
double VelocityGet();
|
double VelocityGet();
|
||||||
float Friction() const;
|
float Friction() const;
|
||||||
@@ -352,16 +346,16 @@ private:
|
|||||||
// loads content of specified file and converts it into a vertex array
|
// loads content of specified file and converts it into a vertex array
|
||||||
static gfx::vertex_array deserialize_profile( std::string const &Profile );
|
static gfx::vertex_array deserialize_profile( std::string const &Profile );
|
||||||
// provides direct access to vertex data of specified profile
|
// provides direct access to vertex data of specified profile
|
||||||
static gfx::vertex_array const & track_rail_profile( int const Profile );
|
static gfx::vertex_array const & track_rail_profile( int Profile );
|
||||||
// returns texture length for specified material
|
// returns texture length for specified material
|
||||||
float texture_length( material_handle const Material );
|
float texture_length( material_handle Material );
|
||||||
// creates profile for a part of current path
|
// creates profile for a part of current path
|
||||||
void create_switch_trackbed( gfx::vertex_array &Output );
|
void create_switch_trackbed( gfx::vertex_array &Output );
|
||||||
void create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
|
void create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
|
||||||
void create_track_blade_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
|
void create_track_blade_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
|
||||||
void create_track_bed_profile( gfx::vertex_array &Output, TTrack const *Previous, TTrack const *Next );
|
void create_track_bed_profile( gfx::vertex_array &Output, TTrack const *Previous, TTrack const *Next );
|
||||||
void create_road_profile( gfx::vertex_array &Output, bool const Forcetransition = false );
|
void create_road_profile( gfx::vertex_array &Output, bool Forcetransition = false );
|
||||||
void create_road_side_profile( gfx::vertex_array &Right, gfx::vertex_array &Left, gfx::vertex_array const &Road, bool const Forcetransition = false );
|
void create_road_side_profile( gfx::vertex_array &Right, gfx::vertex_array &Left, gfx::vertex_array const &Road, bool Forcetransition = false );
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// resolves the sleeper model/skin via the model and material managers, and fills
|
/// resolves the sleeper model/skin via the model and material managers, and fills
|
||||||
/// m_sleeper_local_transforms by walking the active segment(s) at m_sleeper_frequency.
|
/// m_sleeper_local_transforms by walking the active segment(s) at m_sleeper_frequency.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
// constructor
|
// constructor
|
||||||
TTractionPowerSource( scene::node_data const &Nodedata );
|
TTractionPowerSource( scene::node_data const &Nodedata );
|
||||||
// methods
|
// methods
|
||||||
void Init(double const u, double const i);
|
void Init(double u, double i);
|
||||||
bool Load(cParser *parser);
|
bool Load(cParser *parser);
|
||||||
bool Update(double dt);
|
bool Update(double dt);
|
||||||
double CurrentGet(double res);
|
double CurrentGet(double res);
|
||||||
@@ -73,7 +73,7 @@ class powergridsource_table : public basic_table<TTractionPowerSource> {
|
|||||||
public:
|
public:
|
||||||
// legacy method, calculates changes in simulation state over specified time
|
// legacy method, calculates changes in simulation state over specified time
|
||||||
void
|
void
|
||||||
update( double const Deltatime );
|
update( double Deltatime );
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
TTrack * SetCurrentTrack(TTrack *pTrack, int end);
|
TTrack * SetCurrentTrack(TTrack *pTrack, int end);
|
||||||
bool Move(double fDistance, bool bPrimary);
|
bool Move(double fDistance, bool bPrimary);
|
||||||
inline TTrack * GetTrack() const {
|
TTrack * GetTrack() const {
|
||||||
return pCurrentTrack; };
|
return pCurrentTrack; };
|
||||||
// przechyłka policzona przy ustalaniu pozycji
|
// przechyłka policzona przy ustalaniu pozycji
|
||||||
inline double GetRoll() {
|
double GetRoll() {
|
||||||
return vAngles.x; };
|
return vAngles.x; };
|
||||||
//{return pCurrentSegment->GetRoll(fCurrentDistance)*fDirection;}; //zamiast liczyć można pobrać
|
//{return pCurrentSegment->GetRoll(fCurrentDistance)*fDirection;}; //zamiast liczyć można pobrać
|
||||||
// zwrot na torze
|
// zwrot na torze
|
||||||
inline double GetDirection() const {
|
double GetDirection() const {
|
||||||
return fDirection; };
|
return fDirection; };
|
||||||
// ABu-030403
|
// ABu-030403
|
||||||
inline double GetTranslation() const {
|
double GetTranslation() const {
|
||||||
return fCurrentDistance; };
|
return fCurrentDistance; };
|
||||||
// inline double GetLength(vector3 p1, vector3 cp1, vector3 cp2, vector3 p2)
|
// inline double GetLength(vector3 p1, vector3 cp1, vector3 cp2, vector3 p2)
|
||||||
//{ return pCurrentSegment->ComputeLength(p1,cp1,cp2,p2); };
|
//{ return pCurrentSegment->ComputeLength(p1,cp1,cp2,p2); };
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class TTrainParameters
|
|||||||
bool IsMaintenance() const;
|
bool IsMaintenance() const;
|
||||||
bool IsTimeToGo(double hh, double mm);
|
bool IsTimeToGo(double hh, double mm);
|
||||||
// returns: difference between specified time and scheduled departure from current stop, in seconds
|
// returns: difference between specified time and scheduled departure from current stop, in seconds
|
||||||
double seconds_until_departure( double const Hour, double const Minute ) const;
|
double seconds_until_departure( double Hour, double Minute ) const;
|
||||||
bool UpdateMTable(double hh, double mm, std::string const &NewName);
|
bool UpdateMTable(double hh, double mm, std::string const &NewName);
|
||||||
bool UpdateMTable( scenario_time const &Time, std::string const &NewName );
|
bool UpdateMTable( scenario_time const &Time, std::string const &NewName );
|
||||||
bool RewindTimeTable( std::string actualStationName );
|
bool RewindTimeTable( std::string actualStationName );
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
|
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
|
||||||
double
|
double
|
||||||
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int const Platform );
|
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int Platform );
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace simulation {
|
namespace simulation {
|
||||||
|
|||||||
Reference in New Issue
Block a user