222 {
223 Particle p;
224 vector particle_orientation;
226
228
230 {
232
233 if (p)
234 {
235 particle_orientation =
m_OutSpeed.VectorToAngles();
236 particle_orientation = particle_orientation + "0 -90 0";
237 p.SetOrientation(particle_orientation);
238
240 }
241 }
242 else
243 {
245
246 if (p)
247 {
249 {
251 particle_orientation = particle_orientation + "0 270 0";
252 }
253 else
254 {
255 particle_orientation = "0 0 0";
256 }
257
258 p.SetOrientation(particle_orientation);
259
261 }
262
264 {
266
267 if (p)
268 {
269 particle_orientation =
m_OutSpeed.VectorToAngles();
270 particle_orientation = particle_orientation + "0 -90 0";
271 p.SetOrientation(particle_orientation);
272
274 }
275 }
276 else
277 {
279 {
281 vector inSpeedN =
m_InSpeed.Normalized();
282 vector bounce_ori = surfNormalN + inSpeedN;
283
284 float dot = vector.
Dot(bounce_ori, surfNormalN);
285
287 {
289
290 if (p)
291 {
293 particle_orientation = particle_orientation + "0 -90 0";
294 p.SetOrientation(particle_orientation);
295
297 }
298 }
299 }
300 }
301 }
302
303 if (p)
304 {
306 }
307
308
309
310
311 if (
Type() != Hit_MeatBones )
312 {
315
316
317 float scaling_by_distance = distance * 0.01;
318
319
320 float current_FOV = Camera.GetCurrentFOV();
321 float config_FOV =
GetDayZGame().GetUserFOVFromConfig();
322 float FOV_scale = current_FOV / config_FOV;
323 scaling_by_distance = 1 + scaling_by_distance * FOV_scale;
324
325 if (scaling_by_distance > 1.1)
326 {
327 Particle p_distant = gPM.PlayInWorld(ParticleList.IMPACT_DISTANT_DUST,
m_Pos);
328
330 particle_orientation[1] = particle_orientation[1] + 270;
331 p_distant.SetOrientation(particle_orientation);
332
338 }
339 }
340 }
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
proto native vector GetCurrentCameraPosition()
void OnEnterAngledCalculations(Particle p)
void OnEnterCalculations(Particle p)
void OnExitCalculations(Particle p, float outSpeedf)
void OnRicochetCalculations(Particle p, float outspeedf)
void SetParticle(Particle p)
Sets the main particle which this Effect will manage.
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
void ScaleParticleParam(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their CURRENT value.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto native CGame GetGame()