16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 06:59:18 +02:00

partial support for cab switch types, basic precipitation level texture selection

This commit is contained in:
tmj-fstate
2018-09-29 20:14:28 +02:00
parent 226ddb6291
commit 467d46eba2
7 changed files with 389 additions and 138 deletions

13
Gauge.h
View File

@@ -12,7 +12,7 @@ http://mozilla.org/MPL/2.0/.
#include "Classes.h"
#include "sound.h"
enum class TGaugeType {
enum class TGaugeAnimation {
// typ ruchu
gt_Unknown, // na razie nie znany
gt_Rotate, // obrót
@@ -21,6 +21,11 @@ enum class TGaugeType {
gt_Digital // licznik cyfrowy, np. kilometrów
};
enum class TGaugeType {
toggle,
push
};
// animowany wskaźnik, mogący przyjmować wiele stanów pośrednich
class TGauge {
@@ -32,7 +37,7 @@ public:
inline
void Clear() {
*this = TGauge(); }
void Init(TSubModel *Submodel, TGaugeType 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, 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 );
bool Load(cParser &Parser, TDynamicObject const *Owner, TModel3d *md1, TModel3d *md2 = nullptr, double mul = 1.0);
void UpdateValue( float fNewDesired );
void UpdateValue( float fNewDesired, sound_source &Fallbacksound );
@@ -46,6 +51,7 @@ public:
void UpdateValue();
// returns offset of submodel associated with the button from the model centre
glm::vec3 model_offset() const;
TGaugeType type() const;
// members
TSubModel *SubModel { nullptr }; // McZapkie-310302: zeby mozna bylo sprawdzac czy zainicjowany poprawnie
@@ -60,7 +66,8 @@ private:
GetScaledValue() const;
// members
TGaugeType m_type { TGaugeType::gt_Unknown }; // typ ruchu
TGaugeAnimation m_animation { TGaugeAnimation::gt_Unknown }; // typ ruchu
TGaugeType m_type { TGaugeType::toggle }; // switch type
float m_friction { 0.f }; // hamowanie przy zliżaniu się do zadanej wartości
float m_targetvalue { 0.f }; // wartość docelowa
float m_value { 0.f }; // wartość obecna