Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс EffectParticle

Wrapper class for managing particles through SEffectManager. Подробнее...

+ Граф наследования:EffectParticle:

Защищенные члены

EffectType

Information about what type of effect the Effect is, without the need for casting

override EffectType GetEffectType ()
 Get what type of effect the Effect is.
 
override bool IsParticle ()
 Check whether the Effect is EffectParticle without casting.
 
Main particle

Set or get the main particle which this Effect will manage

void SetParticle (Particle p)
 Sets the main particle which this Effect will manage.
 
Particle GetParticle ()
 Gets the main particle which this Effect is managing.
 
Playback

Methods to Play/Stop Effect Generally, SEffectManager.Play methods are used instead of Start

override void Start ()
 Plays all elements this effect consists of.
 
override void Stop ()
 Stops all elements this effect consists of.
 
Attach

Helper methods for attaching to prent

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.
 
Events

Various events that can be overriden for custom behaviour

void Event_OnPlayStart ()
 Event which just simply exists (DEPRECATED)
 
void Event_OnPlayStarted ()
 Event which just simply exists (DEPRECATED)
 
Generic API

Setters and getters for generic data and properties

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.
 

Защищенные данные

Particle m_ParticleObj
 The main Particle effect that this Effect wrapper manages.
 
Generic data

Generic data for the particle

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.
 

DEPRECATED

Methods which exist for backwards compatibility and are no longer in use or have never been in use

vector m_ParticleOrientation
 
Object m_Object
 
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)
 

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

Wrapper class for managing particles through SEffectManager.

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

◆ EffectParticle()

void EffectParticle ( )
inlineprotected

ctor

35 {
36
37 }

◆ ~EffectParticle()

void ~EffectParticle ( )
inlineprotected

dtor

43 {
44
45 }

Методы

◆ AddAsChild()

void AddAsChild ( Object obj,
vector local_pos,
vector local_ori,
bool force_rotation_to_world )
inlineprotected

Helper method to attach to parent.

252 {
254 if (p)
255 {
256 p.AddAsChild(obj, local_pos, local_ori, force_rotation_to_world);
257 }
258 }
Particle GetParticle()
Gets the main particle which this Effect is managing.
Definition EffectParticle.c:162
Definition EntityAI.c:95
Legacy way of using particles in the game.
Definition Particle.c:7

Перекрестные ссылки GetParticle().

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

◆ AttachTo()

void AttachTo ( Object obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_rotation_to_world = false )
inlineprotected

Read Particle.AddAsChild.

228 {
229 // Update the cached variables...
230 SetParent(obj);
234
235 // Now attach it
237 }
void SetParent(Object parent_obj)
Set parent of the Effect.
Definition Effect.c:394
void SetLocalPosition(vector pos)
Set the local position of the Effect.
Definition Effect.c:476
void SetAttachedLocalOri(vector ori)
Set local orientation for the Effectparticle to attach to when the Effect is started.
Definition Effect.c:601
void ForceParticleRotationRelativeToWorld(bool state)
Set orientation setting to be used by the effect when the Effect starts.
Definition EffectParticle.c:503
void AddAsChild(Object obj, vector local_pos, vector local_ori, bool force_rotation_to_world)
Helper method to attach to parent.
Definition EffectParticle.c:251

Перекрестные ссылки AddAsChild(), ForceParticleRotationRelativeToWorld(), SetAttachedLocalOri(), SetLocalPosition() и SetParent().

◆ CheckLifeSpan()

void CheckLifeSpan ( )
inlineprotected

Was never called and probably should never be called.

Предупреждения
Emptied the functionality as it is relatively unsafe...
551 {
552 /*
553 if ( !m_ParticleObj )
554 {
555 delete this;
556 }
557
558 OnCheckUpdate();
559 */
560 }

◆ Event_OnPlayStart()

void Event_OnPlayStart ( )
inlineprotected

Event which just simply exists (DEPRECATED)

Предупреждения
Never called or used
Заметки
Use Event_OnStarted instead
275 {
276
277 }

◆ Event_OnPlayStarted()

void Event_OnPlayStarted ( )
inlineprotected

Event which just simply exists (DEPRECATED)

Предупреждения
Never called or used
Заметки
Use Event_OnStarted instead
285 {
286
287 }

◆ ForceParticleRotationRelativeToWorld()

void ForceParticleRotationRelativeToWorld ( bool state)
inlineprotected

Set orientation setting to be used by the effect when the Effect starts.

Предупреждения
Only caches it into a variable to be used by Start, does not live update when called afterwards
Заметки
There is no way to update this immediately
Аргументы
statebool Whether to keep WS orientation when attaching it to parent
504 {
506 }
bool m_ForceRotationRelativeToWorld
Orientation setting to be used by the effect when the Effect starts.
Definition EffectParticle.c:18

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

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

◆ GetCurrentLocalPosition()

override vector GetCurrentLocalPosition ( )
inlineprotected

Get the current local position of the managed Particle.

Возвращает
vector The current local position of the managed Particle
432 {
434
435 if (p)
436 {
437 Object parent = GetParent();
438
439 if (parent)
440 return parent.WorldToModel(p.GetPosition());
441 else
442 return p.GetPosition();
443 }
444 else
445 return super.GetLocalPosition();
446 }
Definition ObjectTyped.c:2
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:405

Перекрестные ссылки GetParent() и GetParticle().

◆ GetCurrentOrientation()

vector GetCurrentOrientation ( )
inlineprotected

Get the current orientation of the managed Particle.

Возвращает
vector The current orientation of the managed Particle
488 {
490
491 if (p)
492 return p.GetOrientation();
493 else
494 return vector.Zero;
495 }
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки GetParticle() и vector::Zero.

◆ GetCurrentParent()

override Object GetCurrentParent ( )
inlineprotected

Get the current parent of the managed Particle.

Возвращает
Object The currrent parent of the Particle
368 {
370
371 if (p)
372 return Object.Cast(p.GetParent());
373 else
374 return super.GetParent();
375 }

Перекрестные ссылки GetParticle().

◆ GetCurrentParticleID()

int GetCurrentParticleID ( )
inlineprotected

Gets the current id of the managed Particle.

Возвращает
int Particle ID registered in ParticleList
339 {
341 if (p)
342 {
343 return p.GetParticleID();
344 }
345 else
346 {
347 return ParticleList.INVALID;
348 }
349 }
Definition ParticleList.c:12
static const int INVALID
Definition ParticleList.c:20

Перекрестные ссылки GetParticle() и ParticleList::INVALID.

◆ GetCurrentPosition()

override vector GetCurrentPosition ( )
inlineprotected

Get the current world position of the managed Particle.

Возвращает
vector The current world position of the managed Particle
397 {
399
400 if (p)
401 return p.GetPosition();
402 else
403 return super.GetPosition();
404 }

Перекрестные ссылки GetParticle().

◆ GetDebugName()

override string GetDebugName ( )
inlineprotected

Override when getting debug information.

68 {
69 string identifier;
70 if (GetParticle())
71 {
72 identifier = GetParticle().GetDebugNameNative();
73 }
74 else
75 {
76 identifier = "NO_PARTICLE";
77 }
78
79 return string.Format("%1:%2:%3", super.GetDebugName(), m_ParticleID, identifier);
80 }
int m_ParticleID
The ID in the ParticleList to create Particle from.
Definition EffectParticle.c:14

Перекрестные ссылки GetParticle() и m_ParticleID.

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

◆ GetEffectType()

override EffectType GetEffectType ( )
inlineprotected

Get what type of effect the Effect is.

Возвращает
EffectType What type of effect the Effect is
108 {
109 return EffectType.PARTICLE;
110 }
EffectType
Enum to determine what type of effect the Effect is.
Definition Effect.c:3

◆ GetOrientation()

vector GetOrientation ( )
inlineprotected

Get the orientation of the EffectParticle.

Предупреждения
Only gets the cached variable, for immediate effect use GetCurrent variant
Возвращает
vector The orientation of EffectParticle
464 {
465 return m_Orientation;
466 }
vector m_Orientation
Orientation set by SetOrientation.
Definition EffectParticle.c:16

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

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

◆ GetParticle()

Particle GetParticle ( )
inlineprotected

Gets the main particle which this Effect is managing.

Возвращает
Particle Main particle which this Effect is managing
163 {
164 return m_ParticleObj;
165 }
Particle m_ParticleObj
The main Particle effect that this Effect wrapper manages.
Definition EffectParticle.c:7

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

Используется в AddAsChild(), EffEngineSmoke::Event_OnFrameUpdate(), GetCurrentLocalPosition(), GetCurrentOrientation(), GetCurrentParent(), GetCurrentParticleID(), GetCurrentPosition(), GetDebugName(), IsParticleCurrentRotationRelativeToWorld(), IsParticleRotationRelativeToWorld(), SetCurrentLocalPosition(), SetCurrentOrientation(), SetCurrentParticleID(), SetCurrentPosition(), EffExhaustSmoke::SetParticleStateLight(), Stop(), EffCoolantSteam::UpdateParticle() и ValidateStart().

◆ GetParticleID()

int GetParticleID ( )
inlineprotected

Gets the id of the particle to be used.

Предупреждения
Only gets the cached variable, for immediate effect use GetCurrent variant
Возвращает
int Particle ID registered in ParticleList
314 {
315 return m_ParticleID;
316 }

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

◆ InitEffect()

override void InitEffect ( )
inlineprotected

init

51 {
52 super.InitEffect();
53
54 // Would be neat, but since particles are often already playing
55 // BEFORE they are even registered as the particle for the Effect
56 // Better to just keep that one I guess..
57 // Event_OnStarted.Remove(Event_OnEffectStarted);
58
59 // Will be called by the particle events
61 }
ref ScriptInvoker Event_OnEffectEnded
Event used when the actual effect stopped playing.
Definition Effect.c:25
ref ScriptInvoker Event_OnStopped
Event used when Stop was called.
Definition Effect.c:23

Перекрестные ссылки Event_OnEffectEnded и Event_OnStopped.

◆ IsParticle()

override bool IsParticle ( )
inlineprotected

Check whether the Effect is EffectParticle without casting.

Возвращает
bool Whether the Effect is EffectParticle
117 {
118 return true;
119 }

◆ IsParticleCurrentRotationRelativeToWorld()

bool IsParticleCurrentRotationRelativeToWorld ( )
inlineprotected

Get the current orientation setting to be used by the managed Particle.

Возвращает
bool Whether the managed Particle is only updating position from parent
528 {
530
531 if (p)
532 return p.IsHierarchyPositionOnly();
533 else
534 return false;
535 }

Перекрестные ссылки GetParticle().

◆ IsParticleRotationRelativeToWorld()

bool IsParticleRotationRelativeToWorld ( )
inlineprotected

Get the orientation setting to be used by the effect when the Effect starts.

Предупреждения
Only gets the cached variable, for immediate effect use IsParticleCurrentRotationRelativeToWorld
Возвращает
bool Whether to keep WS orientation when attaching it to parent
514 {
516
517 if (p)
518 return p.IsHierarchyPositionOnly();
519 else
521 }

Перекрестные ссылки GetParticle() и m_ForceRotationRelativeToWorld.

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

◆ ReAttach()

void ReAttach ( )
inlineprotected

Helper method to attach to parent using stored settings.

243 {
244 // Skip the updating, as we are going to reuse what was set before
246 }
vector GetLocalPosition()
Get the local position of the Effect.
Definition Effect.c:486
vector GetAttachedLocalOri()
Get the local orientation set by SetAttachedLocalOri.
Definition Effect.c:611
bool IsParticleRotationRelativeToWorld()
Get the orientation setting to be used by the effect when the Effect starts.
Definition EffectParticle.c:513

Перекрестные ссылки AddAsChild(), GetAttachedLocalOri(), GetLocalPosition(), GetParent() и IsParticleRotationRelativeToWorld().

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

◆ SetCurrentLocalPosition()

override void SetCurrentLocalPosition ( vector pos,
bool updateCached = true )
inlineprotected

Set the current local position of the managed Particle.

Аргументы
posvector The current local position for the managed Particle
updateCachedbool Whether to update the cached variable
412 {
413 super.SetCurrentLocalPosition(pos, updateCached);
414
416 if (p)
417 {
418 Object parent = GetParent();
419
420 if (parent)
421 ReAttach();
422 else
423 p.SetPosition(pos);
424 }
425 }
void ReAttach()
Helper method to attach to parent using stored settings.
Definition EffectParticle.c:242

Перекрестные ссылки GetParent(), GetParticle() и ReAttach().

◆ SetCurrentOrientation()

void SetCurrentOrientation ( vector ori,
bool updateCached = true )
inlineprotected

Set the current orientation of the managed Particle.

Аргументы
orivector Orientation in degrees (yaw, pitch, roll)
473 {
474 if ( updateCached)
476
478
479 if (p)
480 p.SetOrientation(ori);
481 }
void SetOrientation(vector ori)
Set orientation of the EffectParticle.
Definition EffectParticle.c:453

Перекрестные ссылки GetParticle() и SetOrientation().

◆ SetCurrentParent()

override void SetCurrentParent ( Object parent_obj,
bool updateCached = true )
inlineprotected

Set current parent of the managed Particle.

Аргументы
parent_objObject The parent for the Particle
updateCachedbool Whether to update the cached variable
357 {
358 super.SetCurrentParent(parent_obj, updateCached);
359
360 ReAttach();
361 }

Перекрестные ссылки ReAttach().

◆ SetCurrentParticleID()

void SetCurrentParticleID ( int id)
inlineprotected

Sets the id of the particle to be used.

Заметки
Particle will not update immediately, but ParticleSource will
Аргументы
idint Particle ID registered in ParticleList
324 {
326
328 if (p)
329 {
330 p.SetSource(id);
331 }
332 }

Перекрестные ссылки GetParticle() и m_ParticleID.

◆ SetCurrentPosition()

override void SetCurrentPosition ( vector pos,
bool updateCached = true )
inlineprotected

Set the current world position of the managed Particle.

Аргументы
posvector The current world position for the Particle
updateCachedbool Whether to update the cached variable
383 {
384 super.SetCurrentPosition(pos, updateCached);
385
387
388 if (p)
389 p.SetPosition(pos);
390 }

Перекрестные ссылки GetParticle().

◆ SetDecalOwner()

void SetDecalOwner ( Object o)
inlineprotected
563 {
564 m_Object = o;
565 }
Object m_Object
Definition EffectParticle.c:26

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

◆ SetOrientation()

void SetOrientation ( vector ori)
inlineprotected

Set orientation of the EffectParticle.

Предупреждения
Only sets the cached variable, for immediate effect use SetCurrent variant
Аргументы
orivector Orientation in degrees (yaw, pitch, roll)
454 {
456 }

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

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

◆ SetParticle()

void SetParticle ( Particle p)
inlineprotected

Sets the main particle which this Effect will manage.

Аргументы
pParticle Main particle which this Effect will manage
135 {
136 // Unregister the events on the old
137 if (m_ParticleObj)
138 {
139 ParticleEvents ope = m_ParticleObj.GetEvents();
140 ope.Event_OnParticleStart.Remove(Event_OnEffectStarted);
141 ope.Event_OnParticleStop.Remove(Event_OnEffectEnded);
142 }
143
144 // Assign the new main Particle
146
147 // Register the events on the new
148 if (m_ParticleObj)
149 {
150 ParticleEvents npe = m_ParticleObj.GetEvents();
151 npe.Event_OnParticleStart.Insert(Event_OnEffectStarted);
152 // We will use Stop instead of End, as old particles were destroyed when they stopped
153 // And this system kinda relies on that
154 npe.Event_OnParticleStop.Insert(Event_OnEffectEnded);
155 }
156 }
ref ScriptInvoker Event_OnEffectStarted
Event used when the actual effect started playing.
Definition Effect.c:24
Invokers for ParticleBase events, called from events.
Definition ParticleBase.c:16

Перекрестные ссылки Event_OnEffectEnded, Event_OnEffectStarted и m_ParticleObj.

Используется в EffBulletImpactBase::Event_OnStarted(), Start() и Stop().

◆ SetParticleID()

◆ Start()

override void Start ( )
inlineprotected

Plays all elements this effect consists of.

Заметки
Is called by SEffectManager.Play methods
182 {
183 if (m_ParticleID > 0)
184 {
185 vector pos = GetPosition();
187
188 if (m_ParentObject)
189 {
190 pos = GetLocalPosition();
192 }
193
194 SetParticle(ParticleManager.GetInstance().CreateParticle(m_ParticleID, pos, true, GetParent(), ori, IsParticleRotationRelativeToWorld()));
195 }
196
197 super.Start();
198 }
Object m_ParentObject
Cached parent.
Definition Effect.c:39
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
vector GetOrientation()
Get the orientation of the EffectParticle.
Definition EffectParticle.c:463
void SetParticle(Particle p)
Sets the main particle which this Effect will manage.
Definition EffectParticle.c:134

Перекрестные ссылки GetAttachedLocalOri(), GetLocalPosition(), GetOrientation(), GetParent(), GetPosition, IsParticleRotationRelativeToWorld(), m_ParentObject, m_ParticleID, ParticleManager() и SetParticle().

Используется в EffVehicleSmoke::SetParticleState().

◆ Stop()

override void Stop ( )
inlineprotected

Stops all elements this effect consists of.

Заметки
Alternatively use SEffectManager.Stop( effect_id )
205 {
206 if ( GetParticle() )
207 {
208 GetParticle().Stop();
210 }
211
212 super.Stop();
213 }
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:266

Перекрестные ссылки GetParticle(), SetParticle() и Particle::Stop().

Используется в EffVehicleSmoke::SetParticleState() и ValidateStart().

◆ ValidateStart()

override void ValidateStart ( )
inlineprotected

Validation whether an effect truly started playing or if the Effect should stop as none is present.

Заметки
Override this when inheriting to create own validation check
Is called from Event_OnStarted invoker after Event_OnStarted has been performed
88 {
89 if (!GetParticle())
90 {
91 ErrorEx(string.Format("No Particle started playing, stopping EffectParticle: %1", GetDebugName()), ErrorExSeverity.WARNING);
92 Stop();
93 }
94 }
override string GetDebugName()
Override when getting debug information.
Definition EffectParticle.c:67
override void Stop()
Stops all elements this effect consists of.
Definition EffectParticle.c:204
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, GetDebugName(), GetParticle() и Stop().

Поля

◆ m_ForceRotationRelativeToWorld

bool m_ForceRotationRelativeToWorld
protected

Orientation setting to be used by the effect when the Effect starts.

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

◆ m_Object

Object m_Object
protected

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

◆ m_Orientation

vector m_Orientation
protected

Orientation set by SetOrientation.

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

◆ m_ParticleID

int m_ParticleID
protected

The ID in the ParticleList to create Particle from.

Используется в GetDebugName(), GetParticleID(), SetCurrentParticleID(), SetParticleID() и Start().

◆ m_ParticleObj

Particle m_ParticleObj
protected

The main Particle effect that this Effect wrapper manages.

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

◆ m_ParticleOrientation

vector m_ParticleOrientation
protected

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