Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс EffBulletImpactBase
+ Граф наследования:EffBulletImpactBase:

Закрытые члены

void EffBulletImpactBase ()
 
override void OnCheckUpdate ()
 
void SetEnterParticle (int id)
 
void SetExitParticle (int id)
 
void SetRicochetParticle (int id)
 
void SetSingleParticle (int id)
 
void SetAngledEnterValue (float f)
 
void EvaluateEffect (Object directHit, int componentIndex, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, string ammoType)
 
float CalculateStoppingForce (float in_speedf, float out_speedf, string ammoType, float weight)
 
void OnEnterCalculations (Particle p)
 
void OnExitCalculations (Particle p, float outSpeedf)
 
void OnRicochetCalculations (Particle p, float outspeedf)
 
void OnEnterAngledCalculations (Particle p)
 
override void Event_OnStarted ()
 
- Закрытые члены унаследованные от EffectParticle
override EffectType GetEffectType ()
 Get what type of effect the Effect is.
 
override bool IsParticle ()
 Check whether the Effect is EffectParticle without casting.
 
void SetParticle (Particle p)
 Sets the main particle which this Effect will manage.
 
Particle GetParticle ()
 Gets the main particle which this Effect is managing.
 
override void Start ()
 Plays all elements this effect consists of.
 
override void Stop ()
 Stops all elements this effect consists of.
 
void AttachTo (Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
 Read Particle.AddAsChild.
 
void ReAttach ()
 Helper method to attach to parent using stored settings.
 
void AddAsChild (Object obj, vector local_pos, vector local_ori, bool force_rotation_to_world)
 Helper method to attach to parent.
 
void Event_OnPlayStart ()
 Event which just simply exists (DEPRECATED)
 
void Event_OnPlayStarted ()
 Event which just simply exists (DEPRECATED)
 
void SetParticleID (int id)
 Sets the id of the particle to be used.
 
int GetParticleID ()
 Gets the id of the particle to be used.
 
void SetCurrentParticleID (int id)
 Sets the id of the particle to be used.
 
int GetCurrentParticleID ()
 Gets the current id of the managed Particle.
 
override void SetCurrentParent (Object parent_obj, bool updateCached=true)
 Set current parent of the managed Particle.
 
override Object GetCurrentParent ()
 Get the current parent of the managed Particle.
 
override void SetCurrentPosition (vector pos, bool updateCached=true)
 Set the current world position of the managed Particle.
 
override vector GetCurrentPosition ()
 Get the current world position of the managed Particle.
 
override void SetCurrentLocalPosition (vector pos, bool updateCached=true)
 Set the current local position of the managed Particle.
 
override vector GetCurrentLocalPosition ()
 Get the current local position of the managed Particle.
 
void SetOrientation (vector ori)
 Set orientation of the EffectParticle.
 
vector GetOrientation ()
 Get the orientation of the EffectParticle.
 
void SetCurrentOrientation (vector ori, bool updateCached=true)
 Set the current orientation of the managed Particle.
 
vector GetCurrentOrientation ()
 Get the current orientation of the managed Particle.
 
void ForceParticleRotationRelativeToWorld (bool state)
 Set orientation setting to be used by the effect when the Effect starts.
 
bool IsParticleRotationRelativeToWorld ()
 Get the orientation setting to be used by the effect when the Effect starts.
 
bool IsParticleCurrentRotationRelativeToWorld ()
 Get the current orientation setting to be used by the managed Particle.
 
void EffectParticle ()
 ctor
 
void ~EffectParticle ()
 dtor
 
override void InitEffect ()
 init
 
override string GetDebugName ()
 Override when getting debug information.
 
override void ValidateStart ()
 Validation whether an effect truly started playing or if the Effect should stop as none is present.
 
void CheckLifeSpan ()
 Was never called and probably should never be called.
 
void SetDecalOwner (Object o)
 

Закрытые данные

float MIN_SCALING_PARAM = 0.1
 
Object m_DirectHit
 
float m_StoppingForce
 
float m_Weight
 
int m_ImpactType
 
int m_ComponentIndex
 
vector m_Pos
 
vector m_SurfNormal
 
vector m_ExitPos
 
vector m_InSpeed
 
vector m_OutSpeed
 
string m_AmmoType
 
int m_ParticleEnter = -1
 
int m_ParticleExit = -1
 
int m_ParticleRicochet = -1
 
float m_EnterSplashCoef = 0.003
 
float m_ExitSplashCoef = 0.002
 
float m_RicochetSplashCoef = 0.002
 
float m_EnterAngledSplashCoef = 0.01
 
float m_AngledEnter = 0.40
 
- Закрытые данные унаследованные от EffectParticle
Particle m_ParticleObj
 The main Particle effect that this Effect wrapper manages.
 
int m_ParticleID
 The ID in the ParticleList to create Particle from.
 
vector m_Orientation
 Orientation set by SetOrientation.
 
bool m_ForceRotationRelativeToWorld
 Orientation setting to be used by the effect when the Effect starts.
 
vector m_ParticleOrientation
 
Object m_Object
 

Закрытые статические данные

static const int SURVIVOR_HEAD = 0
 
static const int INFECTED_HEAD = 3
 
static float DEFAULT_PROJECTILE_WEIGHT = 0.015
 
static vector INVALID = "0 0 0"
 

Подробное описание

Конструктор(ы)

◆ EffBulletImpactBase()

void EffBulletImpactBase ( )
inlineprivate
36 {
37
38 }

Методы

◆ CalculateStoppingForce()

float CalculateStoppingForce ( float in_speedf,
float out_speedf,
string ammoType,
float weight )
inlineprivate
89 {
90 if ( m_ImpactType == ImpactTypes.MELEE )
91 {
92 return Math.RandomFloat(50, 100);
93 }
94
96
98
99 return stopping_force;
100 }
ImpactTypes
Definition ImpactEffects.c:2
int m_ImpactType
Definition BulletImpactBase.c:12
static float DEFAULT_PROJECTILE_WEIGHT
Definition BulletImpactBase.c:5
Definition EnMath.c:7
Definition EntityAI.c:95
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки DEFAULT_PROJECTILE_WEIGHT, m_ImpactType и Math::RandomFloat().

Используется в EvaluateEffect().

◆ EvaluateEffect()

void EvaluateEffect ( Object directHit,
int componentIndex,
vector pos,
int impact_type,
vector surfNormal,
vector exitPos,
vector inSpeed,
vector outSpeed,
string ammoType )
inlineprivate
73 {
75 m_Pos = pos;
83 m_Weight = GetGame().ConfigGetFloat("CfgAmmo " + ammoType + " weight");
84
86 }
vector m_InSpeed
Definition BulletImpactBase.c:17
vector m_ExitPos
Definition BulletImpactBase.c:16
vector m_Pos
Definition BulletImpactBase.c:14
float m_Weight
Definition BulletImpactBase.c:11
vector m_OutSpeed
Definition BulletImpactBase.c:18
string m_AmmoType
Definition BulletImpactBase.c:19
int m_ComponentIndex
Definition BulletImpactBase.c:13
float CalculateStoppingForce(float in_speedf, float out_speedf, string ammoType, float weight)
Definition BulletImpactBase.c:88
float m_StoppingForce
Definition BulletImpactBase.c:10
vector m_SurfNormal
Definition BulletImpactBase.c:15
Object m_DirectHit
Definition BulletImpactBase.c:9
proto native float Length()
Returns length of vector (magnitude)
proto native CGame GetGame()

Перекрестные ссылки CalculateStoppingForce(), GetGame(), vector::Length(), m_AmmoType, m_ComponentIndex, m_DirectHit, m_ExitPos, m_ImpactType, m_InSpeed, m_OutSpeed, m_Pos, m_StoppingForce, m_SurfNormal и m_Weight.

◆ Event_OnStarted()

override void Event_OnStarted ( )
inlineprivate
222 {
223 Particle p;
225 float outSpeedf = m_OutSpeed.Length();
226
227 ParticleManager gPM = ParticleManager.GetInstance();
228
229 if ( m_ImpactType == ImpactTypes.RICOCHET )
230 {
231 p = gPM.PlayInWorld(m_ParticleRicochet, m_Pos);
232
233 if (p)
234 {
237 p.SetOrientation(particle_orientation);
238
240 }
241 }
242 else
243 {
244 p = gPM.PlayInWorld(m_ParticleEnter, m_Pos );
245
246 if (p)
247 {
248 if (m_SurfNormal != INVALID)
249 {
252 }
253 else
254 {
255 particle_orientation = "0 0 0"; // This vector is in angles
256 }
257
258 p.SetOrientation(particle_orientation);
259
261 }
262
263 if (outSpeedf > 0 && m_SurfNormal != INVALID)
264 {
265 p = gPM.PlayInWorld(m_ParticleExit, m_ExitPos);
266
267 if (p)
268 {
271 p.SetOrientation(particle_orientation);
272
274 }
275 }
276 else
277 {
278 if (m_SurfNormal != INVALID)
279 {
283
285
286 if ( dot > m_AngledEnter )
287 {
288 p = gPM.PlayInWorld(m_ParticleRicochet, m_Pos);
289
290 if (p)
291 {
292 particle_orientation = bounce_ori.VectorToAngles();
294 p.SetOrientation(particle_orientation);
295
297 }
298 }
299 }
300 }
301 }
302
303 if (p)
304 {
305 SetParticle(p);
306 }
307
308
309 // Additional impact particle over long ranges. It shows players where their bullets land
310
311 if ( Type() != Hit_MeatBones )
312 {
313 vector camera_pos = GetGame().GetCurrentCameraPosition();
315
316 // Additional size increase by distance from camera
317 float scaling_by_distance = distance * 0.01;
318
319 // Now scale down the above size increase by player's zoom-in value
320 float current_FOV = Camera.GetCurrentFOV();
321 float config_FOV = GetDayZGame().GetUserFOVFromConfig();
324
325 if (scaling_by_distance > 1.1)
326 {
328
331 p_distant.SetOrientation(particle_orientation);
332
333 p_distant.ScaleParticleParam(EmitorParam.SIZE, scaling_by_distance - 0.5);
334 p_distant.ScaleParticleParam(EmitorParam.BIRTH_RATE, scaling_by_distance * 0.1);
335 p_distant.ScaleParticleParam(EmitorParam.BIRTH_RATE_RND, scaling_by_distance * 0.1);
336 p_distant.ScaleParticleParam(EmitorParam.LIFETIME, scaling_by_distance * 0.3);
337 p_distant.ScaleParticleParam(EmitorParam.LIFETIME_RND, scaling_by_distance * 0.3);
338 }
339 }
340 }
DayZGame GetDayZGame()
Definition DayZGame.c:3748
string Type
Definition JsonDataContaminatedArea.c:11
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
Definition Camera.c:70
void OnEnterCalculations(Particle p)
Definition BulletImpactBase.c:102
void OnEnterAngledCalculations(Particle p)
Definition BulletImpactBase.c:199
int m_ParticleRicochet
Definition BulletImpactBase.c:26
int m_ParticleExit
Definition BulletImpactBase.c:25
int m_ParticleEnter
Definition BulletImpactBase.c:24
void OnExitCalculations(Particle p, float outSpeedf)
Definition BulletImpactBase.c:155
float m_AngledEnter
Definition BulletImpactBase.c:33
static vector INVALID
Definition BulletImpactBase.c:21
void OnRicochetCalculations(Particle p, float outspeedf)
Definition BulletImpactBase.c:177
void SetParticle(Particle p)
Sets the main particle which this Effect will manage.
Definition EffectParticle.c:134
Definition Hit_MeatBones.c:2
Legacy way of using particles in the game.
Definition Particle.c:7
Definition ParticleList.c:12
static const int IMPACT_DISTANT_DUST
Definition ParticleList.c:193
Definition EnConvert.c:106
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
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.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
EmitorParam
Definition EnVisual.c:114

Перекрестные ссылки vector::Distance(), vector::Dot(), GetDayZGame(), GetGame(), ParticleList::IMPACT_DISTANT_DUST, INVALID, vector::Length(), m_AngledEnter, m_ExitPos, m_ImpactType, m_InSpeed, m_OutSpeed, m_ParticleEnter, m_ParticleExit, m_ParticleRicochet, m_Pos, m_SurfNormal, vector::Normalized(), OnEnterAngledCalculations(), OnEnterCalculations(), OnExitCalculations(), OnRicochetCalculations(), ParticleManager(), EffectParticle::SetParticle(), Type и vector::VectorToAngles().

◆ OnCheckUpdate()

override void OnCheckUpdate ( )
inlineprivate
41 {
42 //DbgUI.Text( m_ammoType );
43 }

◆ OnEnterAngledCalculations()

void OnEnterAngledCalculations ( Particle p)
inlineprivate
200 {
205
208
211
214
215 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
216 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
217 p.ScaleParticleParam(EmitorParam.SIZE, size);
218 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
219 }
float MIN_SCALING_PARAM
Definition BulletImpactBase.c:7
float m_EnterAngledSplashCoef
Definition BulletImpactBase.c:32

Перекрестные ссылки m_EnterAngledSplashCoef, m_StoppingForce и MIN_SCALING_PARAM.

Используется в Event_OnStarted().

◆ OnEnterCalculations()

void OnEnterCalculations ( Particle p)
inlineprivate
103 {
104 // All values represent scale
112
113 if ( m_AmmoType == "Bullet_12GaugePellets" )
114 {
115 birth_rate *= 0.5;
116 velocity_min *= 2;
117 velocity_max *= 2;
118 }
119
120
121 if (velocity_min < 0.75)
122 velocity_min = 0.75;
123
124 if (size < 0.75)
125 size = 0.75;
126
127 if (lifetime < 0.5)
128 lifetime = 0.5;
129
130 if (lifetime_rnd < 0.5)
131 lifetime_rnd = 0.5;
132
133 if (velocity_max < 1)
134 velocity_max = 1;
135
136 /*Print("===============");
137 Print(velocity_min);
138 Print(velocity_max);
139 Print(size);
140 Print(birth_rate);
141 Print(air_resistance);
142 Print(lifetime);
143 Print(lifetime_rnd);*/
144
145 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
146 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
147 p.ScaleParticleParam(EmitorParam.SIZE, size);
148 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
149 p.ScaleParticleParam(EmitorParam.AIR_RESISTANCE, air_resistance);
150 p.ScaleParticleParam(EmitorParam.AIR_RESISTANCE_RND, air_resistance);
151 p.ScaleParticleParam(EmitorParam.LIFETIME, lifetime);
152 p.ScaleParticleParam(EmitorParam.LIFETIME_RND, lifetime_rnd);
153 }
float m_EnterSplashCoef
Definition BulletImpactBase.c:29

Перекрестные ссылки m_AmmoType, m_EnterSplashCoef и m_StoppingForce.

Используется в Event_OnStarted().

◆ OnExitCalculations()

void OnExitCalculations ( Particle p,
float outSpeedf )
inlineprivate
156 {
159 float size = 1 + ( outSpeedf * m_ExitSplashCoef);
160 float birth_rate = 1 + (outSpeedf * m_ExitSplashCoef);
161
164
167
170
171 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
172 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
173 p.ScaleParticleParam(EmitorParam.SIZE, size);
174 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
175 }
float m_ExitSplashCoef
Definition BulletImpactBase.c:30

Перекрестные ссылки m_ExitSplashCoef и MIN_SCALING_PARAM.

Используется в Event_OnStarted().

◆ OnRicochetCalculations()

void OnRicochetCalculations ( Particle p,
float outspeedf )
inlineprivate
178 {
183
186
189
192
193 p.ScaleParticleParam(EmitorParam.VELOCITY, velocity_min);
194 p.ScaleParticleParam(EmitorParam.VELOCITY_RND, velocity_max);
195 p.ScaleParticleParam(EmitorParam.SIZE, size);
196 p.ScaleParticleParam(EmitorParam.BIRTH_RATE, birth_rate);
197 }
float m_RicochetSplashCoef
Definition BulletImpactBase.c:31

Перекрестные ссылки m_RicochetSplashCoef, m_StoppingForce и MIN_SCALING_PARAM.

Используется в Event_OnStarted().

◆ SetAngledEnterValue()

void SetAngledEnterValue ( float f)
inlineprivate
68 {
70 }

Перекрестные ссылки m_AngledEnter.

◆ SetEnterParticle()

◆ SetExitParticle()

◆ SetRicochetParticle()

◆ SetSingleParticle()

void SetSingleParticle ( int id)
inlineprivate
61 {
65 }
void SetExitParticle(int id)
Definition BulletImpactBase.c:50
void SetRicochetParticle(int id)
Definition BulletImpactBase.c:55
void SetEnterParticle(int id)
Definition BulletImpactBase.c:45

Перекрестные ссылки SetEnterParticle(), SetExitParticle() и SetRicochetParticle().

Используется в Hit_ErrorNoMaterial::Hit_ErrorNoMaterial(), Hit_MeatBones_MeleeFist::Hit_MeatBones_MeleeFist(), Hit_Undefined::Hit_Undefined() и Hit_Water::Hit_Water().

Поля

◆ DEFAULT_PROJECTILE_WEIGHT

◆ INFECTED_HEAD

const int INFECTED_HEAD = 3
staticprivate

◆ INVALID

vector INVALID = "0 0 0"
staticprivate

Используется в Event_OnStarted().

◆ m_AmmoType

string m_AmmoType
private

◆ m_AngledEnter

◆ m_ComponentIndex

int m_ComponentIndex
private

Используется в EvaluateEffect().

◆ m_DirectHit

Object m_DirectHit
private

◆ m_EnterAngledSplashCoef

float m_EnterAngledSplashCoef = 0.01
private

Используется в OnEnterAngledCalculations().

◆ m_EnterSplashCoef

◆ m_ExitPos

vector m_ExitPos
private

◆ m_ExitSplashCoef

◆ m_ImpactType

◆ m_InSpeed

vector m_InSpeed
private

◆ m_OutSpeed

vector m_OutSpeed
private

◆ m_ParticleEnter

int m_ParticleEnter = -1
private

Используется в Event_OnStarted() и SetEnterParticle().

◆ m_ParticleExit

int m_ParticleExit = -1
private

Используется в Event_OnStarted() и SetExitParticle().

◆ m_ParticleRicochet

int m_ParticleRicochet = -1
private

Используется в Event_OnStarted() и SetRicochetParticle().

◆ m_Pos

vector m_Pos
private

◆ m_RicochetSplashCoef

float m_RicochetSplashCoef = 0.002
private

Используется в OnRicochetCalculations().

◆ m_StoppingForce

◆ m_SurfNormal

vector m_SurfNormal
private

◆ m_Weight

float m_Weight
private

Используется в EvaluateEffect().

◆ MIN_SCALING_PARAM

◆ SURVIVOR_HEAD

const int SURVIVOR_HEAD = 0
staticprivate

Объявления и описания членов класса находятся в файле: