DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс EffectBoatWaterBack
+ Граф наследования:EffectBoatWaterBack:

Защищенные члены

void EffectBoatWaterBack ()
 
void UpdateSpeedState (Particle ptc, float speed)
 
override void Update ()
 

Защищенные данные

const int EMITORS_FAST = 5
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от EffectBoatWaterBase
override void AttachTo (Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
 
void SetParticleState (int state)
 
void EnableEmitor (Particle ptc, int id, bool enable)
 
void UpdateSpeedState (Particle ptc, float speed)
 
void Update ()
 
void UpdatePosToSeaLevel (float surfaceOffset=0)
 
- Закрытые данные унаследованные от EffectBoatWaterBase
int m_EmitorCount
 
int m_SpeedSlow
 
int m_SpeedMedium
 
int m_SpeedFast
 
EBoatSpeed m_SpeedState
 
BoatScript m_Boat
 
vector m_MemPointPos
 

Подробное описание

Конструктор(ы)

◆ EffectBoatWaterBack()

void EffectBoatWaterBack ( )
inlineprotected
121 {
122 m_EmitorCount = 10;
123 m_SpeedSlow = 25;
124 m_SpeedMedium = 50;
125 m_SpeedFast = 150;
126
128 }
int m_EmitorCount
Definition BoatWaterEffects.c:273
void SetParticleState(int state)
Definition BoatWaterEffects.c:289
int m_SpeedFast
Definition BoatWaterEffects.c:276
int m_SpeedSlow
Definition BoatWaterEffects.c:274
int m_SpeedMedium
Definition BoatWaterEffects.c:275
Definition ParticleList.c:12
static const int BOAT_WATER_BACK
Definition ParticleList.c:275

Перекрестные ссылки ParticleList::BOAT_WATER_BACK, EffectBoatWaterBase::m_EmitorCount, EffectBoatWaterBase::m_SpeedFast, EffectBoatWaterBase::m_SpeedMedium, EffectBoatWaterBase::m_SpeedSlow и EffectBoatWaterBase::SetParticleState().

Методы

◆ Update()

override void Update ( )
inlineprotected
167 {
168 if (m_Boat.GetCurrentGear() == 0)
169 {
170 if (IsPlaying())
171 {
173 GetParticle().SetParticleParam(EmitorParam.BIRTH_RATE_RND, 0);
174 Stop();
175 };
176
177 return;
178 }
179
180 super.Update();
182
183 float speed = m_Boat.PropellerGetAngularVelocity();
184 UpdateSpeedState(ptc, speed);
185
186 float lerp = Math.InverseLerp(0, m_SpeedFast, speed);
187
188 for (int i = 0; i < m_EmitorCount; i++)
189 {
191 {
192 ptc.SetParameter(i, EmitorParam.SIZE, ptc.GetParameterOriginal(i, EmitorParam.SIZE) * lerp);
193 ptc.SetParameter(i, EmitorParam.BIRTH_RATE, ptc.GetParameterOriginal(i, EmitorParam.BIRTH_RATE) * lerp);
194 }
195 }
196 }
EBoatSpeed
Definition BoatWaterEffects.c:2
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
Definition Effect.c:195
void UpdateSpeedState(Particle ptc, float speed)
Definition BoatWaterEffects.c:130
BoatScript m_Boat
Definition BoatWaterEffects.c:279
Particle GetParticle()
Gets the main particle which this Effect is managing.
Definition EffectParticle.c:162
override void Stop()
Stops all elements this effect consists of.
Definition EffectParticle.c:204
Definition EnMath.c:7
Definition EntityAI.c:95
Legacy way of using particles in the game.
Definition Particle.c:7
void SetParticleParam(int parameter_id, float value)
Set the value of a parameter of all emitors in the particle.
Definition Particle.c:611
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
EmitorParam
Definition EnVisual.c:114

Перекрестные ссылки EffectParticle::GetParticle(), Math::InverseLerp(), IsPlaying(), EffectBoatWaterBase::m_Boat, EffectBoatWaterBase::m_EmitorCount, EffectBoatWaterBase::m_SpeedFast, Particle::SetParticleParam(), EffectParticle::Stop() и UpdateSpeedState().

◆ UpdateSpeedState()

void UpdateSpeedState ( Particle ptc,
float speed )
inlineprotected
131 {
133
134 if (speed > m_SpeedFast)
136 else if (speed > m_SpeedMedium)
137 m_SpeedState = EBoatSpeed.MEDIUM;
138 else if (speed > m_SpeedSlow)
140 else
141 m_SpeedState = EBoatSpeed.SLOWEST;
142
144 return;
145
146 for (int i = 0; i < m_EmitorCount; i++)
147 {
148 if (i < EMITORS_FAST) // big splash
149 {
150 if (m_SpeedState <= EBoatSpeed.SLOW)
151 EnableEmitor(ptc, i, false);
152 else
153 EnableEmitor(ptc, i, true);
154 }
155
156 if (i >= EMITORS_FAST && i != 9)
157 {
158 if (m_SpeedState == EBoatSpeed.SLOWEST)
159 EnableEmitor(ptc, i, false);
160 else
161 EnableEmitor(ptc, i, true);
162 }
163 }
164 }
const int EMITORS_FAST
Definition BoatWaterEffects.c:118
EBoatSpeed m_SpeedState
Definition BoatWaterEffects.c:278
void EnableEmitor(Particle ptc, int id, bool enable)
Definition BoatWaterEffects.c:303

Перекрестные ссылки EMITORS_FAST, EffectBoatWaterBase::EnableEmitor(), EffectBoatWaterBase::m_EmitorCount, EffectBoatWaterBase::m_SpeedFast, EffectBoatWaterBase::m_SpeedMedium, EffectBoatWaterBase::m_SpeedSlow и EffectBoatWaterBase::m_SpeedState.

Используется в Update().

Поля

◆ EMITORS_FAST

const int EMITORS_FAST = 5
protected

Используется в UpdateSpeedState().


Объявления и описания членов класса находятся в файле: