Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
hit_wood.c
Go to the documentation of this file.
2{
9
10 override void OnEnterCalculations( Particle p )
11 {
12 // All values represent scale
13 float velocity_min = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef);
14 float velocity_max = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef);
16 float birth_rate = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef)*0.5;
17
18 if (velocity_min < MIN_SCALING_PARAM)
19 velocity_min = MIN_SCALING_PARAM;
20
21 if (size < MIN_SCALING_PARAM)
22 size = MIN_SCALING_PARAM;
23
24 if (birth_rate < MIN_SCALING_PARAM)
25 birth_rate = MIN_SCALING_PARAM;
26
27
28
29 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
30 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
31 p.ScaleParticleParam(EmitorParam.SIZE, size);
32 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
33 }
34
35 override void OnExitCalculations(Particle p, float outSpeedf)
36 {
37 float velocity_min = 1 + (outSpeedf * m_ExitSplashCoef);
38 float velocity_max = 1 + (outSpeedf * m_ExitSplashCoef);
39 float size = 1 + ( outSpeedf * m_ExitSplashCoef)*0.5;
40 float birth_rate = 1 + (outSpeedf * m_ExitSplashCoef)*0.5;
41
42 if (velocity_min < MIN_SCALING_PARAM)
43 velocity_min = MIN_SCALING_PARAM;
44
45 if (size < MIN_SCALING_PARAM)
46 size = MIN_SCALING_PARAM;
47
48 if (birth_rate < MIN_SCALING_PARAM)
49 birth_rate = MIN_SCALING_PARAM;
50
51 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
52 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
53 p.ScaleParticleParam(EmitorParam.SIZE, size);
54 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
55 }
56}
void SetExitParticle(int id)
void SetRicochetParticle(int id)
void SetEnterParticle(int id)
override void OnEnterCalculations(Particle p)
Definition hit_wood.c:10
override void OnExitCalculations(Particle p, float outSpeedf)
Definition hit_wood.c:35
void Hit_Wood()
Definition hit_wood.c:3
Legacy way of using particles in the game.
Definition particle.c:7
void ScaleParticleParam(int parameter_id, float coef)
Scales the given parameter on all emitors relatively to their CURRENT value.
Definition particle.c:697
static const int IMPACT_WOOD_RICOCHET
static const int IMPACT_WOOD_EXIT
static const int IMPACT_WOOD_ENTER
EmitorParam
Definition envisual.c:114