3 const float INTENSITY_COEF_OVERALL = 0.8;
4 const float INTENSITY_COEF_BLUR = 1;
5 const float INTENSITY_COEF_COLOR = 0.2;
6 const float INTENSITY_COEF_VIGNETTE = 0.7;
7 const float DURATION_MIN = 0.6;
14 float m_ShockIntensityMax;
18 float duration_coef =
Math.Clamp(intensity_max,DURATION_MIN,1);
19 m_HitDuration = 1 * duration_coef;
20 m_BreakPoint = 0.2 * duration_coef;
21 m_ShockIntensityMax =
Math.Clamp(intensity_max,0,1);
31 PPERequesterBank.GetRequester(PPERequester_ShockHitReaction).Stop();
34 void Update(
float deltatime)
44 float tmp_value =
Math.InverseLerp(m_BreakPoint, m_HitDuration,
m_TimeActive);
45 value = 1 - tmp_value;
49 value =
Math.Clamp(value,0,1);
52 float val =
Math.Clamp(
Math.Lerp(0, m_ShockIntensityMax, value),0,m_ShockIntensityMax);
53 float val_color =
Math.Clamp(val * INTENSITY_COEF_COLOR,0,m_ShockIntensityMax);
56 float blur = val * INTENSITY_COEF_OVERALL * INTENSITY_COEF_BLUR;
57 float factor = val_color * INTENSITY_COEF_OVERALL;
58 float vignette = val * INTENSITY_COEF_OVERALL * INTENSITY_COEF_VIGNETTE;
60 m_EffectParam.param1 = blur;
61 m_EffectParam.param2 = vignette;
62 m_EffectParam.param3 = factor;
63 PPERequesterBank.GetRequester(PPERequester_ShockHitReaction).Start(m_EffectParam);