DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PPERHMPGhosts.c
См. документацию.
1class PPERequester_HMPGhosts extends PPERequester_GameplayBase
2{
3 protected bool m_PulseActive;
4 protected float m_PulseProgress;
5
6 protected ref array<float> m_ChannelWeights = { 0, 0, 0, 0 };
7 protected ref array<float> m_ColorMod = { 1, 1, 1, 1 };
8
9 protected bool m_Stopping;
10 protected bool m_StopNext;
11 protected float m_FadeOutTimeTarget;
12 protected float m_FadingTimeElapsed;
13 protected float m_FadingProgress;
14 protected float m_ElapsedTime;
15
16 override protected void OnStart(Param par = null)
17 {
18 super.OnStart(par);
19
20 m_Stopping = false;
21 m_StopNext = false;
22 m_ElapsedTime = 0.0;
24 m_FadingProgress = 0.0;
25
26 //following changes only performed once, on start
27 //noise
28 float nScaleX = 0.05; //inverse scaling!
29 float nScaleY = 0.05; //inverse scaling!
30 //ghosts
31 float gOffsetX = 30;
32 float gOffsetY = 13;
33 float gScaleX = 1; //inverse scaling!
34 float gScaleY = 1; //inverse scaling!
35 //color modulation
36 m_ColorMod[0] = 0.8;
37 m_ColorMod[1] = 0.8;
38 m_ColorMod[2] = 0.8;
39 m_ColorMod[3] = 0.85;
40
48 }
49
50 override protected void OnUpdate(float delta)
51 {
52 if (m_StopNext)
53 {
54 if (m_IsRunning)
55 Stop();
56 return;
57 }
58
59 if (m_IsRunning)
60 ProcessSimulation(delta);
61
62 super.OnUpdate(delta);
63
64 if (m_IsRunning)
66 }
67
68 protected void ProcessSimulation(float delta)
69 {
70 if (m_Stopping)
71 ProcessFading(delta);
72
73 if (m_PulseActive)
74 {
75 //channel weights
76 float time = m_ElapsedTime * 0.65;
77 SampleChannels(time);
78 ReSampleChannels(time);
79
80 //noise
81 float nOffsetX = (Math.Sin( time * 0.29 ) * 0.5 + 0.5) * 0.3;
82 float nOffsetY = (Math.Cos( time * 0.17 ) * 0.5 + 0.5) * 0.3;
83
84 //channel remapping
85 float animLo = (Math.Sin( time ) * 0.5 + 0.5) * 1;
86 float animHi = (Math.Sin( time ) * 0.5 + 0.5) * 1;
87 float rmpLoAll = Math.Lerp(0.1,0.3,animLo);
88 float rmpHiAll = Math.Lerp(0.9,1.2,animHi);
89
95
97 }
98
99 m_ElapsedTime += delta;
100 }
101
102 protected void SampleChannels(float time)
103 {
104 float offset;
105 // luckily 4 channels * 90 fit into 360 nicely, so no need to distribute weights other way
106 for (int i = 0; i < 4; ++i)
107 {
108 offset = i * Math.PI_HALF;
109 m_ChannelWeights[i] = Math.Sin( time + offset );
110 }
111 }
112
113 protected void ReSampleChannels(float time)
114 {
115 float rampingCoef = 1.1;
116 float w = Math.Clamp((Math.Sin(m_PulseProgress * Math.PI) * rampingCoef),0,1);
117 w = Math.Lerp(0,w,1 - m_FadingProgress);
118
119 for (int i = 0; i < 4; ++i)
121 }
122
123 protected void ProcessFading(float delta)
124 {
125 m_FadingTimeElapsed += delta;
127
129 }
130
131 void SetPulseProgress(float progress) //0..1
132 {
133 m_PulseActive = true;
134 m_PulseProgress = progress;
135 }
136
137 void FadeOutEffect(float targetTime)
138 {
139 m_Stopping = true;
140 m_FadeOutTimeTarget = targetTime;
142 }
143}
PPOperators
PP operators, specify operation between subsequent layers.
Определения PPEConstants.c:53
bool m_IsRunning
Определения PPERequestPlatformsBase.c:437
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:588
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:630
void SetRequesterUpdating(bool state)
Has to be set for the requester to be handled.
Определения PPERequestPlatformsBase.c:456
Определения EnMath.c:7
static const int PARAM_NOISE_SCALE_X
Определения PPEGhost.c:8
static const int PARAM_GHOST_SCALE_X
Определения PPEGhost.c:15
static const int PARAM_GHOST_SCALE_Y
Определения PPEGhost.c:16
static const int L_2_HMP
Определения PPEGhost.c:21
static const int L_7_HMP
Определения PPEGhost.c:26
static const int PARAM_GHOST_COLOR_MOD
Определения PPEGhost.c:17
static const int L_8_HMP
Определения PPEGhost.c:27
static const int PARAM_NOISE_REMAP_HI
Определения PPEGhost.c:11
static const int L_3_HMP
Определения PPEGhost.c:22
static const int L_9_HMP
Определения PPEGhost.c:28
static const int PARAM_NOISE_OFFSET_X
Определения PPEGhost.c:6
static const int L_5_HMP
Определения PPEGhost.c:24
static const int PARAM_GHOST_OFFSET_X
Определения PPEGhost.c:13
static const int PARAM_NOISE_OFFSET_Y
Определения PPEGhost.c:7
static const int L_1_HMP
RGB = per channel multiplication A = overall color curve (0=linear,1=exponential)
Определения PPEGhost.c:20
static const int PARAM_GHOST_OFFSET_Y
Определения PPEGhost.c:14
static const int PARAM_NOISE_SCALE_Y
Определения PPEGhost.c:9
static const int PARAM_NOISE_CHANNEL_WEIGHT
Определения PPEGhost.c:5
static const int L_4_HMP
Определения PPEGhost.c:23
static const int L_6_HMP
Определения PPEGhost.c:25
static const int PARAM_NOISE_REMAP_LO
Определения PPEGhost.c:10
Ghost - PostProcessEffectType.Ghost.
Определения PPEGhost.c:3
void SetPulseProgress(float progress)
Определения PPERHMPGhosts.c:131
void ReSampleChannels(float time)
Определения PPERHMPGhosts.c:113
float m_ElapsedTime
Определения PPERHMPGhosts.c:14
float m_PulseProgress
Определения PPERHMPGhosts.c:4
void OnStart(Param par=null)
Определения PPERHMPGhosts.c:16
bool m_PulseActive
Определения PPERHMPGhosts.c:3
bool m_Stopping
Определения PPERHMPGhosts.c:9
void SampleChannels(float time)
Определения PPERHMPGhosts.c:102
void OnUpdate(float delta)
Определения PPERHMPGhosts.c:50
void ProcessFading(float delta)
Определения PPERHMPGhosts.c:123
void FadeOutEffect(float targetTime)
Определения PPERHMPGhosts.c:137
bool m_StopNext
Определения PPERHMPGhosts.c:10
ref array< float > m_ColorMod
Определения PPERHMPGhosts.c:7
float m_FadingTimeElapsed
Определения PPERHMPGhosts.c:12
ref array< float > m_ChannelWeights
Определения PPERHMPGhosts.c:6
float m_FadingProgress
Определения PPERHMPGhosts.c:13
float m_FadeOutTimeTarget
Определения PPERHMPGhosts.c:11
void ProcessSimulation(float delta)
Определения PPERHMPGhosts.c:68
base, not to be used directly, would lead to layering collisions!
Определения PPERBloodLoss.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
PostProcessEffectType
Post-process effect type.
Определения EnWorld.c:72
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static const float PI_HALF
Определения EnMath.c:14
static proto float Cos(float angle)
Returns cosinus of angle in radians.
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 Sin(float angle)
Returns sinus of angle in radians.
static const float PI
Определения EnMath.c:12
void Stop()
Stops all elements this effect consists of.
Определения Effect.c:181