28 if (speed > m_SpeedFast)
30 else if (speed > m_SpeedMedium)
32 else if (speed > m_SpeedSlow)
37 if (m_SpeedState == speedStatePast)
40 for (
int i = 0; i < m_EmitorCount; i++)
49 else if (i == 9 || i == 10)
56 else if (i < 5 || i == 7 || i == 8)
66 override void Update(
float timeSlice = 0)
68 if (m_Boat.GetCurrentGear() == 0)
80 super.Update(timeSlice);
94 for (
int i = 0; i < m_EmitorCount; i++)
96 if (i == 11 || i == 12)
100 else if (i < 5 || i == 7 || i == 8)
104 if (
GetGame().GetWaterDepth(m_Boat.CoordToParent(m_MemPointPos)) < -0.1)
166 override void Update(
float timeSlice = 0)
168 if (
m_Boat.GetCurrentGear() == 0)
180 super.Update(timeSlice);
183 float speed =
m_Boat.PropellerGetAngularVelocity();
190 if (i < EMITORS_FAST && m_SpeedState >
EBoatSpeed.SLOW)
217 if (speed > m_SpeedFast)
219 else if (speed > m_SpeedMedium)
221 else if (speed > m_SpeedSlow)
226 if (m_SpeedState == speedStatePast)
229 for (
int i = 0; i < m_EmitorCount; i++)
241 override void Update(
float timeSlice = 0)
243 super.Update(timeSlice);
248 float speed = velocity.
Normalize() * 3.6;
253 float lerp = Math.InverseLerp(0, m_SpeedFast, speed);
255 for (
int i = 0; i < m_EmitorCount; i++)
289 super.AttachTo(obj, local_pos, local_ori, force_rotation_to_world);
344 posAdjusted =
m_Boat.CoordToLocal(posAdjusted);
void EffectBoatWaterFront()
void EffectBoatWaterSide()
enum EBoatSpeed EMITORS_FAST
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
vector GetLocalPosition()
Get the local position of the Effect.
proto native float SurfaceGetSeaLevel()
void UpdateSpeedState(Particle ptc, float speed)
void EffectBoatWaterBack()
override void Update(float timeSlice=0)
void UpdatePosToSeaLevel(float timeSlice=0, float surfaceOffset=0)
void UpdateSpeedState(Particle ptc, float speed)
const float POS_UPDATE_THROTTLE
void EnableEmitor(Particle ptc, int id, bool enable)
void SetParticleState(int state)
void Update(float timeSlice=0)
override void AttachTo(Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
override void Stop()
Stops all elements this effect consists of.
Particle GetParticle()
Gets the main particle which this Effect is managing.
override void Start()
Plays all elements this effect consists of.
void SetParticleID(int id)
Sets the id of the particle to be used.
void EffectParticle()
ctor
override void SetCurrentLocalPosition(vector pos, bool updateCached=true)
Set the current local position of the managed Particle.
float GetParameterOriginal(int emitter, int parameter)
void SetParticleParam(int parameter_id, float value)
Set the value of a parameter of all emitors in the particle.
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Legacy way of using particles in the game.
static const int BOAT_WATER_SIDE
static const int BOAT_WATER_FRONT
static const int BOAT_WATER_BACK
proto float Normalize()
Normalizes vector. Returns length.
proto native CGame GetGame()
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)