81 DustEffectsSettings dustEffectsSettings =
GetGame().GetMission().GetWorldData().GetDustEffectsSettings();
83 if (dustEffectsSettings.m_GroundEffectEnable)
94 if (dustEffectsSettings.m_CloudEffectEnable)
165 bool temporaryDisable =
false;
241 effect.SetLocalPosition(dustPosition);
242 effect.SetAttachedLocalOri(dustRotation);
248 bool canCreateEffect =
true;
255 float spawnPointHeight;
256 surfaceInfo =
g_Game.GetSurfaceInfoOn(spawnPoint[0], spawnPoint[2], spawnPointHeight);
257 spawnPoint[1] = spawnPointHeight;
264 float endPointSurfaceHeight;
265 endPointSurfaceInfo =
g_Game.GetSurfaceInfoOn(endPoint[0], endPoint[2], endPointSurfaceHeight);
267 if (surfaceInfo.
GetSurfaceType() != endPointSurfaceInfo.GetSurfaceType())
269 canCreateEffect =
false;
278 canCreateEffect =
false;
284 spawnPoint[1] =
GetGame().SurfaceY(spawnPoint[0],spawnPoint[2]);
300 vector dustOrientation = wind;
302 dustOrientation[0] = wind[0];
303 dustOrientation[1] = wind[2];
307 vector surfaceNormal =
GetGame().SurfaceGetNormal(spawnPoint[0],spawnPoint[2]);
308 float dotWithForward =
vector.
Dot(surfaceNormal, wind);
312 dustOrientation[0] = -yaw;
313 dustOrientation[1] = 0;
314 dustOrientation[2] = -pitch;
316 source.SetOrientation(dustOrientation);
324 float PlayerSpeedStr = PlayerSpeed.
Normalize();
326 PlayerSpeed[1] = PlayerSpeed[2];
338 return PlayerPos + point;
353 playerSpeed = trans.GetSpeed();
359 m_Player.PhysicsGetVelocity(playerSpeed);
395 rotation[1] = rotation[2];
406 float playerSpeedStr = playerSpeed.
Normalize();
416 cloudRotation = rotation;
433 #ifdef DIAG_DEVELOPER
449 #ifdef DIAG_DEVELOPER
464 #ifdef DIAG_DEVELOPER
479 #ifdef DIAG_DEVELOPER
558 #ifdef DIAG_DEVELOPER
573 #ifdef DIAG_DEVELOPER
588 #ifdef DIAG_DEVELOPER
598 float frequency =
Math.
Pow(10, - intensityLevel);
610 #ifdef DIAG_DEVELOPER
625 #ifdef DIAG_DEVELOPER
645 #ifdef DIAG_DEVELOPER
666 float t =
Math.
Clamp(windT + variation, 0, 1);
667 return minVal + t * (maxVal - minVal);
723 if (ret ==
string.
Empty)
725 ErrorEx(
"No 'CeilingDustEffectBase'-type paired to particle ID " + particleID +
", using default value. Please add registration into the 'InitCeilingEffect' method.");
726 ret =
"CeilingDustEffecter";
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetGroundEffectIntensity(float intensity)
void SetGroundEffectWindWeight(float windWeight)
void SetCloudEffectThreshold(float threshold)
const float GROUND_EFFECT_SPEED_COEFICIENT
const float CLOUD_BASE_FREQUENCY
float m_GroundEffectIntensity
float GetCloudEffectCooldownMin()
const float CLOUD_EFFECT_ORIGIN_HEIGHT
bool m_EnableCeilingDustEffect
float GetGroundEffectLifetimeMax()
void SetCloudEffectCooldownMin(float cooldown)
float ComputeWindBiasedValue(float windStrength, float minVal, float maxVal)
void SetGroundEffectRadius(float radius)
const float CLOUD_BASE_DURATION
float GetCloudEffectDurationMin()
float m_TimeFromLastGroundEffect
vector GetGroundEffectPotentialPosition()
float m_CloudEffectCooldownMax
bool m_CloudEffectReadFromSurface
float GetGroundEffectThreshold()
void SetGroundEffectSizeRange(float minSize, float maxSize)
void SetCloudEffectDurationMax(float duration)
const float GROUND_EFFECT_WIND_BIAS_VARIATION_RANGE
void InitGroundEffect(DustEffectsSettings dustEffectsSettings)
int IsCeilingDustEffectEnabled()
void SetCloudEffectDistance(float distance)
float m_CloudEffectDurationMin
float GetCloudEffectThreshold()
void SetGroundEffectReadFromSurfaceEnable(bool enable)
void SetCloudEffectCooldown(float cooldown)
const float CLOUD_EFFECT_SPEED_ADJUSTMENT
bool IsGroundEffectReadFromSurfaceEnable()
static string GetCeilingEffectType(int particleID)
Returns effect type paired to the particleID.
void SetGroundEffectEndPointTest(bool endPointtest)
float GetGroundEffectIntensity()
const float GROUND_EFFECT_END_TEST_DISTANCE
float m_GroundEffectLifetimeMin
void SetGroundEffectLifetimeRange(float minLifetime, float maxLifetime)
float GetGroundEffectWindWeight()
bool m_GroundEffectTestEndPoint
float GetGroundEffectSizeMin()
bool IsCloudEffectReadFromSurfaceEnable()
bool IsGroundEffectEnable()
const float BASE_FREQUENCY
static DustEffectManager GetDustEffectManager()
void CalculateCloudEffectPosRot(out vector cloudPositon, out vector cloudRotation)
void CreateGroundEffect()
float m_GroundEffectLifetimeMax
float ComputeCloudEffectCooldown()
bool IsCloudEffectEnable()
void Update(float deltaT)
float GetCloudEffectDistance()
void SetCloudEffectReadFromSurfaceEnable(bool enable)
static ref map< int, string > m_ParticleIDEffectPairing
static ref DustEffectManager m_Instance
float m_CloudEffectDurationMax
float m_TimeFromLastEffect
float m_ActualGroundEffectPeriod
float m_GroundEffectSizeMin
float m_CloudEffectThreshold
static void AdjustCeilingDustEffectFrequency(string surfaceType, int particleID, inout int min, inout int max)
optional adjustment of frequency by particleID
float m_CloudEffectCooldown
void UpdateCloudEffect(float deltaT, float windStrength)
void InitCloudEffect(DustEffectsSettings dustEffectsSettings)
float m_GroundEffectSizeMax
float ComputeCloudEffectDuration()
float m_GroundEffectWindWeight
void UpdateActiveCloudEffect()
float m_GroundEffectRadius
float GetGroundEffectLifetimeMin()
float m_GroundEffectThreshold
void SetCloudEffectEnable(bool enable)
bool m_GroundEffectReadFromSurface
float m_CloudEffectDuration
void RegisterCeilingPair(int particleID, string effectType)
void SetCloudEffectDurationMin(float duration)
void SetGroundEffectEnable(bool enable)
void Init(PlayerBase player)
float GetCloudEffectCooldown()
void SetCeilingDustEffectEnable(bool enable)
float GetGroundEffectSizeMax()
void SetCloudEffectCooldownMax(float cooldown)
float GetCloudEffectDuration()
float GetGroundEffectRadius()
void UpdateGroundEffect(float deltaT, float windStrength)
void SetCloudEffectDuration(float duration)
const float GROUND_EFFECT_SPEED_ADJUSTMENT
float m_CloudEffectCooldownMin
float m_ActualDurationCloud
float m_CloudEffectBaseDistance
void SetGroundEffectThreshold(float threshold)
bool m_EnableGroundEffect
const float GROUND_EFFECT_WIND_BIAS_SPREAD_SCALE
override void SelectFromSurface(SurfaceInfo surfaceInfo)
proto native Transport GetTransport()
static const int CEILING_WOOD
Entity which has the particle instance as an ObjectComponent.
static int PlayOnObject(notnull Effect eff, Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_relative_to_world=false)
Play an Effect.
static Effect GetEffectByID(int effect_id)
Gets the Effect with the given registered Effect ID.
static void Stop(int effect_id)
Stops the Effect.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
Manager class for managing Effect (EffectParticle, EffectSound)
proto int GetGroundEffectParticleId()
proto string GetSurfaceType()
Native class for boats - handles physics simulation.
static vector RotateAroundZeroDeg(vector vec, vector axis, float angle)
Rotate a vector around 0,0,0 by an angle in degrees.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
proto float VectorToYaw()
Returns yaw of vector.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
static proto float ModFloat(float x, float y)
Returns the floating-point remainder of x/y rounded towards zero.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Pow(float v, float power)
Return power of v ^ power.
static const float RAD2DEG
proto void SetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, void value)
proto void GetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)