247 {
248 bool canCreateEffect = true;
249 int particleID = ParticleList.NONE;
250 vector wind =
g_Game.GetWeather().GetWind();
253
255 float spawnPointHeight;
256 surfaceInfo =
g_Game.GetSurfaceInfoOn(spawnPoint[0], spawnPoint[2], spawnPointHeight);
257 spawnPoint[1] = spawnPointHeight;
258
260 {
261 vector endPoint;
264 float endPointSurfaceHeight;
265 endPointSurfaceInfo =
g_Game.GetSurfaceInfoOn(endPoint[0], endPoint[2], endPointSurfaceHeight);
266
267 if (surfaceInfo.
GetSurfaceType() != endPointSurfaceInfo.GetSurfaceType())
268 {
269 canCreateEffect = false;
270 }
271 }
272
273 if (canCreateEffect)
274 {
276 if (particleID == ParticleList.NONE || particleID == ParticleList.INVALID)
277 {
278 canCreateEffect = false;
279 }
280 }
281
282 if (canCreateEffect)
283 {
284 spawnPoint[1] =
GetGame().SurfaceY(spawnPoint[0],spawnPoint[2]);
285
286 ParticleSource source =
ParticleManager.GetInstance().PlayInWorldEx(particleID, null, spawnPoint,
"0 0 0",
true);
287
288
289 float output;
290
293
294
299
300 vector dustOrientation = wind;
301
302 dustOrientation[0] = wind[0];
303 dustOrientation[1] = wind[2];
304
306
307 vector surfaceNormal =
GetGame().SurfaceGetNormal(spawnPoint[0],spawnPoint[2]);
308 float dotWithForward = vector.Dot(surfaceNormal, wind);
309
310 float pitch = Math.Atan2(-dotWithForward, surfaceNormal[1]) * Math.RAD2DEG;
311
312 dustOrientation[0] = -yaw;
313 dustOrientation[1] = 0;
314 dustOrientation[2] = -pitch;
315
316 source.SetOrientation(dustOrientation);
317 }
318 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
float ComputeWindBiasedValue(float windStrength, float minVal, float maxVal)
vector GetGroundEffectPotentialPosition()
const float GROUND_EFFECT_END_TEST_DISTANCE
float m_GroundEffectLifetimeMin
bool m_GroundEffectTestEndPoint
float m_GroundEffectLifetimeMax
float m_GroundEffectSizeMin
float m_GroundEffectSizeMax
proto int GetGroundEffectParticleId()
proto string GetSurfaceType()
proto float Normalize()
Normalizes vector. Returns length.
proto float VectorToYaw()
Returns yaw of vector.
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)