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

Legacy way of using particles in the game. Подробнее...

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

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

Playback

Methods regarding playing/stopping of particle

override void PlayParticle (int particle_id=-1)
 Method to tell the particle to start playing.
 
override bool PlayParticleEx (int particle_id=-1, int flags=0)
 Method to tell the particle to start playing.
 
void Play (int particle_id=-1)
 Legacy function for backwards compatibility with 1.01 and below.
 
override bool StopParticle (int flags=0)
 Method to tell the particle to stop playing.
 
void Stop ()
 Legacy function for backwards compatibility with 1.14 and below.
 
Properties and state

Obtain information or set properties regarding the state of the Particle

void SetSource (int particle_id)
 Sets particle id.
 
int GetParticleID ()
 Gets particle id.
 
Object GetDirectParticleEffect ()
 Returns direct particle effect entity which is usually handled by this class 'Particle' if there is one.
 
Object GetParticleParent ()
 Returns the parent of this Particle if there is one.
 
bool HasActiveParticle ()
 Returns if there is any particle active.
 
int GetParticleCount ()
 Returns the total count of active particles in all emitors.
 
bool IsRepeat ()
 Returns whether there is a repeating particle.
 
float GetMaxLifetime ()
 Returns the approx. max lifetime.
 

Защищенные статические члены

Create a particle (static)

You can create a particle either at some position, or create it as a child on some object.

static Particle CreateOnObject (int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
 Creates a particle emitter and attaches it on the given object.
 
static Particle Create (int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0")
 Legacy function for backwards compatibility.
 
static Particle CreateInWorld (int particle_id, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false)
 Creates a particle emitter on the given position.
 
static Particle Create (int particle_id, vector global_pos, vector global_ori="0 0 0")
 Legacy function for backwards compatibility with 1.01 and below.
 
Static play on creation

You can use the following Play(...) functions to create and activate a particle in 1 line of your script.

static Particle PlayOnObject (int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
 Creates a particle emitter, attaches it on the given object and activates it.
 
static Particle Play (int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0")
 Legacy function for backwards compatibility with 1.01 and below.
 
static Particle PlayInWorld (int particle_id, vector global_pos)
 Creates a particle emitter on the given position and activates it.
 
static Particle Play (int particle_id, vector global_pos)
 Legacy function for backwards compatibility with 1.01 and below.
 

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

Misc

Various helpers

void AddAsChild (Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
 Attaches this particle onto some object. If null value is provided then the particle will be detached from the current parent.
 
Parameter API

Helpful methods for getting or setting parameters

void SetParticleParam (int parameter_id, float value)
 Set the value of a parameter of all emitors in the particle.
 
void SetParameter (int emitter, int parameter, float value)
 Set the value of a parameter of an emitor in the particle.
 
void GetParameter (int emitter, int parameter, out float value)
 Get the value of a parameter of an emitor in the particle.
 
float GetParameterEx (int emitter, int parameter)
 Get the value of a parameter of an emitor in the particle.
 
void ScaleParticleParamFromOriginal (int parameter_id, float coef)
 Scales the given parameter on all emitors relatively to their ORIGINAL value.
 
void ScaleParticleParam (int parameter_id, float coef)
 Scales the given parameter on all emitors relatively to their CURRENT value.
 
void IncrementParticleParamFromOriginal (int parameter_id, float value)
 Increments the value of the given parameter relatively from the ORIGINAL value.
 
void IncrementParticleParam (int parameter_id, float value)
 Increments the value of the given parameter relatively from the CURRENT value.
 

Generic data

Generic data for the Particle

int m_ParticleID
 ID from ParticleList if assigned.
 
float m_Lifetime
 Approx. remaining lifetime of particle.
 
bool m_IsRepeat
 Whether this particle repeats.
 
bool m_MarkedForDeletion
 Whether this particle is queued for deletion.
 

Wiggle API

Settings to make the Particle wiggle

Object m_ParentObject
 Parent Object the Particle is child of.
 
Object m_ParticleEffect
 The child object which contains the actual particle.
 
int m_PreviousFrame
 DEPRECATED.
 
bool m_WiggleProcessing
 Used for Wiggle API, to signal that wiggle API is currently doing work.
 
bool m_ForceOrientationRelativeToWorld
 Used for Wiggle API, to restore after unparenting.
 
vector m_DefaultOri
 Used for Wiggle API, to restore after unparenting.
 
vector m_DefaultPos
 Used for Wiggle API, to restore after unparenting.
 
vector m_DefaultWorldOri
 Used for Wiggle API, to restore after unparenting.
 
vector m_DefaultWorldPos
 Used for Wiggle API, to restore after unparenting.
 
float m_MaxOriWiggle
 Used for Wiggle API, Wiggle room [-m_MaxOriWiggle, m_MaxOriWiggle].
 
float m_MaxOriInterval
 Used for Wiggle API, Interval for wiggling [0, m_MaxOriInterval[.
 
ref Timer m_RandomizeOri
 Used for Wiggle API, calls the Wiggle functionality.
 
vector m_GlobalPosPreviousFrame
 DEPRECATED.
 
const int MAX_EMITORS = 30
 DEPRECATED

 
void Particle ()
 ctor
 
bool IsWiggling ()
 Checks if particle is currently wiggling.
 
void SetWiggle (float random_angle, float random_interval)
 Makes the particle change direction by random_angle every random_interval seconds.
 
void StopWiggle ()
 Stops randomized wiggle.
 
void RandomizeOrientation ()
 Randomizes a new orientation and applies it.
 
void ParticleInit ()
 Purely here so that it can be emptied in ParticleSource.
 
vector RandWiggleVector ()
 Helper to get a randomized wiggle vector.
 
float RandWiggleFloat ()
 Helper to get a randomized wiggle float value.
 

Misc Particle specific helpers

Functionality specific for Particle

void CreateParticleEffect ()
 Creates ParticleEffect child, called from UpdateState.
 
void DestroyParticleEffect ()
 Destroys ParticleEffect child, called from UpdateState.
 
override void EOnFrame (IEntity other, float timeSlice)
 OnFrame update event decrementing the stored approx. lifetime and checking for deletion.
 
void OnCheckAutoDelete ()
 Creates ParticleEffect child, called from UpdateState.
 
void OnToDelete ()
 Called before deletion from OnCheckAutoDelete.
 
void UpdateState ()
 Creates/Destroys ParticleEffect child according to current state.
 

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

Legacy way of using particles in the game.

Заметки
They work okay when just needing to play a particle once every once in a while But are extremely wasteful when it comes to playing multiple Particles at the same time

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

◆ Particle()

void Particle ( )
inlineprivate

ctor

62 {
64 }
void ParticleInit()
Purely here so that it can be emptied in ParticleSource.
Definition Particle.c:67

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

Методы

◆ AddAsChild()

void AddAsChild ( Object parent,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_rotation_to_world = false )
inlineprivate

Attaches this particle onto some object. If null value is provided then the particle will be detached from the current parent.

Заметки
Due to the members being filled in, AddChild/RemoveChild cannot be used with Particle when using Wiggle
Аргументы
parentObject Parent onto which this particle will be attached
local_posvector Attachment position local to the parent (optional)
local_orivector Orientation local to the parent (Pitch, Yawn, Roll in degrees) (Optional)
force_rotation_to_worldbool Force rotation to be in WS (Optional)
564 {
565 if (ToDelete())
566 return;
567
568 if (parent)
569 {
570 // AddAsChild method is sometimes called from a timer.
571 // Due to that it is necesarry to use ToDelete() here to check if the parent object is flagged for deletion or not on client,
572 // because sometimes this code is executed before the parent's destructor from where this would normally be handled.
573 if (!parent.ToDelete())
574 {
576 SetOrientation(local_ori);
577 m_ParentObject = parent;
580
583
584 parent.AddChild(this, -1, false);
585 }
586 }
587 else
588 {
589 if (m_ParentObject && !m_ParentObject.ToDelete())
590 {
591 m_ParentObject.RemoveChild(this, true);
593 }
594 }
595 }
Definition EntityAI.c:95
Object m_ParentObject
Parent Object the Particle is child of.
Definition Particle.c:48
vector m_DefaultPos
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:33
bool m_ForceOrientationRelativeToWorld
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:29
Object m_ParticleEffect
The child object which contains the actual particle.
Definition Particle.c:50
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition Effect.c:436
proto native void AddChild(Widget child, bool immedUpdate=true)

Перекрестные ссылки AddChild(), m_DefaultPos, m_ForceOrientationRelativeToWorld, m_ParentObject, m_ParticleEffect и SetPosition().

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

◆ Create() [1/2]

static Particle Create ( int particle_id,
Object parent_obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0" )
inlinestaticprotected

Legacy function for backwards compatibility.

105 {
107 }
int particle_id
Definition SmokeSimulation.c:28
static Particle CreateOnObject(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter and attaches it on the given object.
Definition Particle.c:88

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

◆ Create() [2/2]

static Particle Create ( int particle_id,
vector global_pos,
vector global_ori = "0 0 0" )
inlinestaticprotected

Legacy function for backwards compatibility with 1.01 and below.

130 {
132 }
static Particle CreateInWorld(int particle_id, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter on the given position.
Definition Particle.c:117

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

◆ CreateInWorld()

static Particle CreateInWorld ( int particle_id,
vector global_pos,
vector global_ori = "0 0 0",
bool force_world_rotation = false )
inlinestaticprotected

Creates a particle emitter on the given position.

Аргументы
particle_idint Particle ID registered in ParticleList
global_posVector Position where the particel will be created
global_orivector Orientation (Pitch, Yawn, Roll in degrees) (Optional)
force_world_rotationbool Forces particle's orientation to rotate relative to the world and not with the object (Optional)
Возвращает
Particle Created particle instance
118 {
119 Particle p = Particle.Cast( GetGame().CreateObjectEx("Particle", global_pos, ECE_LOCAL) );
120 p.SetSource(particle_id);
121 p.SetOrientation(global_ori);
122 p.m_ForceOrientationRelativeToWorld = force_world_rotation;
123 return p;
124 }
const int ECE_LOCAL
Definition CentralEconomy.c:24
Legacy way of using particles in the game.
Definition Particle.c:7
proto native CGame GetGame()

Перекрестные ссылки ECE_LOCAL, GetGame() и particle_id.

Используется в Create(), CreateOnObject() и PlayInWorld().

◆ CreateOnObject()

static Particle CreateOnObject ( int particle_id,
Object parent_obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_world_rotation = false )
inlinestaticprotected

Creates a particle emitter and attaches it on the given object.

Аргументы
particle_idint Particle ID registered in ParticleList
parent_objObject Instance on which this particle will be attached
local_posvector Attachment position local to the parent (Optional)
local_orivector Orientation local to the parent (Pitch, Yawn, Roll in degrees) (Optional)
force_world_rotationbool Forces particle's orientation to rotate relative to the world and not with the object (Optional)
Возвращает
Particle Created particle instance
89 {
90 if (!parent_obj)
91 Error("ERROR when creating a particle! Parameter parent_obj is NULL!");
92
93 vector global_pos = parent_obj.GetPosition();
96 p.m_DefaultOri = local_ori;
97
98 return p;
99 }
Definition EnConvert.c:106
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки CreateInWorld(), Error(), particle_id и Vector().

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

◆ CreateParticleEffect()

void CreateParticleEffect ( )
inlineprivate

Creates ParticleEffect child, called from UpdateState.

441 {
442 if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() )
443 {
445 if (fullPath == "")
446 {
447 ErrorEx("Could not play Particle as there is no valid particle id assigned.");
448 m_IsPlaying = false;
449 return;
450 }
451
452 if ( m_ParticleEffect == null )
453 {
454 m_ParticleEffect = GetGame().CreateObjectEx("#particlesourceenf", vector.Zero, ECE_LOCAL); // particle source must be lowercase!
455 }
456
458
460 m_ParticleEffect.SetObject(vobj, "");
462
465 }
466 }
Object GetObject()
Definition ActionTargets.c:122
bool m_IsPlaying
Whether the Effect is currently playing.
Definition Effect.c:37
int m_ParticleID
ID from ParticleList if assigned.
Definition Particle.c:13
bool IsRepeat()
Returns whether there is a repeating particle.
Definition Particle.c:354
bool m_IsRepeat
Whether this particle repeats.
Definition Particle.c:17
float GetMaxLifetime()
Returns the approx. max lifetime.
Definition Particle.c:380
float m_Lifetime
Approx. remaining lifetime of particle.
Definition Particle.c:15
Definition ParticleList.c:12
static string GetParticleFullPath(int particle_id)
Returns particle's full path (with .ptc suffix) based on its ID.
Definition ParticleList.c:400
static const vector Zero
Definition EnConvert.c:110
Definition proto.c:49
enum ShapeType ErrorEx
proto native void ReleaseObject(vobject object, int flag=0)

Перекрестные ссылки AddChild(), ECE_LOCAL, ErrorEx, GetGame(), GetMaxLifetime(), GetObject(), ParticleList::GetParticleFullPath(), IsRepeat(), m_ForceOrientationRelativeToWorld, m_IsPlaying, m_IsRepeat, m_Lifetime, m_ParticleEffect, m_ParticleID, ReleaseObject() и vector::Zero.

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

◆ DestroyParticleEffect()

void DestroyParticleEffect ( )
inlineprivate

Destroys ParticleEffect child, called from UpdateState.

Заметки
Does not destroy it immediately As it simply nulls the lifetime Then it will be cleaned up by EOnFrame eventually
475 {
476 if ( m_ParticleEffect && GetGame() )
477 {
478 SetParameter(-1, EmitorParam.LIFETIME, 0);
479 SetParameter(-1, EmitorParam.LIFETIME_RND, 0);
480 SetParameter(-1, EmitorParam.REPEAT, 0);
481
482 m_IsRepeat = false;
483 }
484 }
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Definition Particle.c:625
EmitorParam
Definition EnVisual.c:114

Перекрестные ссылки GetGame(), m_IsRepeat, m_ParticleEffect и SetParameter().

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

◆ EOnFrame()

override void EOnFrame ( IEntity other,
float timeSlice )
inlineprivate

OnFrame update event decrementing the stored approx. lifetime and checking for deletion.

490 {
493 }
void OnCheckAutoDelete()
Creates ParticleEffect child, called from UpdateState.
Definition Particle.c:498

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

◆ GetDirectParticleEffect()

Object GetDirectParticleEffect ( )
inlineprotected

Returns direct particle effect entity which is usually handled by this class 'Particle' if there is one.

Заметки
Is a child of this Particle
Возвращает
Object The Object with the particle component or null
308 {
309 return m_ParticleEffect;
310 }

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

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

◆ GetMaxLifetime()

float GetMaxLifetime ( )
inlineprotected

Returns the approx. max lifetime.

Возвращает
float The largest lifetime sum among the emitors
381 {
382 float lifetime_return = 0;
383
385 {
386 float lifetime_min = 0;
387 float lifetime_random = 0;
388 float effect_time = 0;
389
390 float lifetime_sum = 0;
391
393
394 for (int i = 0; i < emitors; ++i)
395 {
399
401
403 {
405 }
406 }
407 }
408
409 return lifetime_return;
410 }
proto int GetParticleEmitorCount(notnull IEntity ent)
proto void GetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParm() и m_ParticleEffect.

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

◆ GetParameter()

void GetParameter ( int emitter,
int parameter,
out float value )
inlineprivate

Get the value of a parameter of an emitor in the particle.

Аргументы
emitterint The emitor to get the value from
parameterint The parameter to get the value from (enum EmitorParam)
valuefloat The value
640 {
641 if (!m_ParticleEffect)
642 return;
643
645 }

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

◆ GetParameterEx()

float GetParameterEx ( int emitter,
int parameter )
inlineprivate

Get the value of a parameter of an emitor in the particle.

Аргументы
emitterint The emitor to get the value from
parameterint The parameter to get the value from (enum EmitorParam)
Возвращает
float The value
654 {
655 if (!m_ParticleEffect)
656 return 0;
657
658 float value;
660 return value;
661 }

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

◆ GetParticleCount()

int GetParticleCount ( )
inlineprotected

Returns the total count of active particles in all emitors.

Заметки
Internally does a sum, HasActiveParticle is better for a quick check
Возвращает
int Total count of active particles
341 {
343 {
345 }
346
347 return 0;
348 }
int ParticleGetCount(IEntity ent)
Definition EnVisual.c:205

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

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

◆ GetParticleID()

int GetParticleID ( )
inlineprotected

Gets particle id.

Заметки
This is not necessarily the CURRENT particle As one can use SetSource while the Particle is still playing But that will not change the particle before Particle is played again
Возвращает
int The last set Particle ID registered in ParticleList
298 {
299 return m_ParticleID;
300 }

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

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

◆ GetParticleParent()

Object GetParticleParent ( )
inlineprotected

Returns the parent of this Particle if there is one.

Возвращает
Object The registered parent or null
317 {
318 return m_ParentObject;
319 }

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

◆ HasActiveParticle()

bool HasActiveParticle ( )
inlineprotected

Returns if there is any particle active.

Возвращает
bool Whether there is any particle active
326 {
328 {
330 }
331
332 return false;
333 }
bool ParticleHasActive(IEntity ent)
Definition EnVisual.c:210

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

◆ IncrementParticleParam()

void IncrementParticleParam ( int parameter_id,
float value )
inlineprivate

Increments the value of the given parameter relatively from the CURRENT value.

Заметки
It's a simple sum, so negative value decrements
Аргументы
parameter_idint The parameter to adjust (enum EmitorParam)
valuefloat The value to sum
728 {
729 if (!m_ParticleEffect)
730 return;
731
733 for (int i = 0; i < emitors; ++i)
734 {
735 float param;
738 }
739 }
proto void SetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, void value)

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParm(), m_ParticleEffect и SetParticleParm().

◆ IncrementParticleParamFromOriginal()

void IncrementParticleParamFromOriginal ( int parameter_id,
float value )
inlineprivate

Increments the value of the given parameter relatively from the ORIGINAL value.

Заметки
It's a simple sum, so negative value decrements
Аргументы
parameter_idint The parameter to adjust (enum EmitorParam)
valuefloat The value to sum
708 {
709 if (!m_ParticleEffect)
710 return;
711
713 for (int i = 0; i < emitors; ++i)
714 {
715 float param;
718 }
719 }
proto void GetParticleParmOriginal(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParmOriginal(), m_ParticleEffect и SetParticleParm().

◆ IsRepeat()

bool IsRepeat ( )
inlineprotected

Returns whether there is a repeating particle.

Возвращает
bool whether there is a repeating particle
355 {
357 {
358 bool repeat = false;
359
361
362 for (int i = 0; i < emitors; ++i)
363 {
365
366 if (repeat)
367 {
368 return true;
369 }
370 }
371 }
372
373 return false;
374 }

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParm() и m_ParticleEffect.

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

◆ IsWiggling()

bool IsWiggling ( )
inlineprivate

Checks if particle is currently wiggling.

754 {
755 return m_RandomizeOri && m_RandomizeOri.IsRunning();
756 }
ref Timer m_RandomizeOri
Used for Wiggle API, calls the Wiggle functionality.
Definition Particle.c:44

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

Используется в ParticleSource::OnParticleStop(), ParticleSource::OnParticleUnParented(), ParticleSource::SetWiggle() и ParticleSource::StopWiggle().

◆ OnCheckAutoDelete()

void OnCheckAutoDelete ( )
inlineprivate

Creates ParticleEffect child, called from UpdateState.

499 {
500 if (m_Lifetime <= 0)
501 {
503 {
504 m_IsRepeat = IsRepeat(); // It is possible that the REPEAT flag was changed during lifetime, so it needs to be checked again.
505
506 if ( m_IsRepeat )
507 {
509 }
510 else
511 {
513
514 if ( GetParticleCount() == 0 )
515 {
516 m_MarkedForDeletion = true;
517 OnToDelete();
519 }
520 }
521 }
522 else
523 {
525 {
527 {
528 m_ParticleEffect.Delete();
530 }
531
532 Delete();
533 }
534 }
535 }
536 }
void OnParticleEnd()
Event when the particle ends.
Definition ParticleBase.c:206
void OnParticleStop()
Event when the particle stops.
Definition ParticleBase.c:188
bool m_MarkedForDeletion
Whether this particle is queued for deletion.
Definition Particle.c:19
void OnToDelete()
Called before deletion from OnCheckAutoDelete.
Definition Particle.c:541
int GetParticleCount()
Returns the total count of active particles in all emitors.
Definition Particle.c:340

Перекрестные ссылки GetMaxLifetime(), GetParticleCount(), IsRepeat(), m_IsRepeat, m_Lifetime, m_MarkedForDeletion, m_ParticleEffect, OnParticleEnd(), OnParticleStop() и OnToDelete().

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

◆ OnToDelete()

void OnToDelete ( )
inlineprivate

Called before deletion from OnCheckAutoDelete.

542 {
543
544 }

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

◆ ParticleInit()

void ParticleInit ( )
inlineprotected

Purely here so that it can be emptied in ParticleSource.

68 {
69 SetFlags(EntityFlags.VISIBLE, true);
70 SetEventMask(EntityEvent.INIT);
71 SetEventMask(EntityEvent.FRAME);
72 }
proto native void SetFlags(ShapeFlags flags)
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:45
EntityFlags
Entity flags.
Definition EnEntity.c:115

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

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

◆ Play() [1/3]

static Particle Play ( int particle_id,
Object parent_obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0" )
inlinestaticprotected

Legacy function for backwards compatibility with 1.01 and below.

164 {
166 }
static Particle PlayOnObject(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter, attaches it on the given object and activates it.
Definition Particle.c:152

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

◆ Play() [2/3]

static Particle Play ( int particle_id,
vector global_pos )
inlinestaticprotected

Legacy function for backwards compatibility with 1.01 and below.

186 {
188 }
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Definition Particle.c:174

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

◆ Play() [3/3]

void Play ( int particle_id = -1)
inlineprotected

Legacy function for backwards compatibility with 1.01 and below.

Аргументы
particle_idint Particle ID registered in ParticleList to start playing
234 {
236 }
override void PlayParticle(int particle_id=-1)
Method to tell the particle to start playing.
Definition Particle.c:203

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

◆ PlayInWorld()

static Particle PlayInWorld ( int particle_id,
vector global_pos )
inlinestaticprotected

Creates a particle emitter on the given position and activates it.

Аргументы
particle_idint Particle ID registered in ParticleList
global_posVector Position where the particel will be created
Возвращает
Particle Created particle instance
175 {
177 p.PlayParticle();
178
179 return p;
180 }

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

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

◆ PlayOnObject()

static Particle PlayOnObject ( int particle_id,
Object parent_obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_world_rotation = false )
inlinestaticprotected

Creates a particle emitter, attaches it on the given object and activates it.

Аргументы
particle_idint Particle ID registered in ParticleList
parent_objObject Instance on which this particle will be attached
local_posvector Attachment position local to the parent (Optional)
local_orivector Orientation local to the parent (Pitch, Yaw, Roll in degrees) (Optional)
force_world_rotationbool Forces particle's orientation to rotate relative to the world and not with the object (Optional)
Возвращает
Particle Created particle instance
153 {
155 p.PlayParticle();
156
157 return p;
158 }

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

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

◆ PlayParticle()

override void PlayParticle ( int particle_id = -1)
inlineprotected

Method to tell the particle to start playing.

Аргументы
particle_idint Particle ID registered in ParticleList to start playing
204 {
206 }
override bool PlayParticleEx(int particle_id=-1, int flags=0)
Method to tell the particle to start playing.
Definition Particle.c:215

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

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

◆ PlayParticleEx()

override bool PlayParticleEx ( int particle_id = -1,
int flags = 0 )
inlineprotected

Method to tell the particle to start playing.

Заметки
The parameter to set the ID will only work when the particle is not already playing
Аргументы
particle_idint Particle ID registered in ParticleList to start playing
flagsint Flags to pass to the playing (None on this level)
Возвращает
bool Whether the particle successfully started
216 {
217 if ( particle_id > -1 )
218 {
220 }
221
223
224 UpdateState();
225
226 return true;
227 }
void OnParticleStart()
Event when the particle starts.
Definition ParticleBase.c:179
void UpdateState()
Creates/Destroys ParticleEffect child according to current state.
Definition Particle.c:425
void SetSource(int particle_id)
Sets particle id.
Definition Particle.c:285

Перекрестные ссылки OnParticleStart(), particle_id, SetSource() и UpdateState().

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

◆ RandomizeOrientation()

void RandomizeOrientation ( )
inlineprivate

Randomizes a new orientation and applies it.

802 {
803 m_WiggleProcessing = true;
804
805 if (m_ParentObject)
806 {
807 if ( !m_RandomizeOri.IsRunning() )
808 {
809 m_RandomizeOri.Run( Math.RandomFloat(0, m_MaxOriInterval) , this, "RandomizeOrientation", NULL, false);
810 }
811
813 AddAsChild( null );
815 }
816
817 m_WiggleProcessing = false;
818 }
Definition EnMath.c:7
Definition ObjectTyped.c:2
vector m_DefaultOri
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:31
bool m_WiggleProcessing
Used for Wiggle API, to signal that wiggle API is currently doing work.
Definition Particle.c:27
void AddAsChild(Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
Attaches this particle onto some object. If null value is provided then the particle will be detached...
Definition Particle.c:563
float m_MaxOriInterval
Used for Wiggle API, Interval for wiggling [0, m_MaxOriInterval[.
Definition Particle.c:42
vector RandWiggleVector()
Helper to get a randomized wiggle vector.
Definition Particle.c:823
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки AddAsChild(), m_DefaultOri, m_DefaultPos, m_MaxOriInterval, m_ParentObject, m_RandomizeOri, m_WiggleProcessing, Math::RandomFloat() и RandWiggleVector().

◆ RandWiggleFloat()

float RandWiggleFloat ( )
inlineprotected

Helper to get a randomized wiggle float value.

832 {
834 }
float m_MaxOriWiggle
Used for Wiggle API, Wiggle room [-m_MaxOriWiggle, m_MaxOriWiggle].
Definition Particle.c:40
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

Перекрестные ссылки m_MaxOriWiggle и Math::RandomFloatInclusive().

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

◆ RandWiggleVector()

vector RandWiggleVector ( )
inlineprotected

Helper to get a randomized wiggle vector.

824 {
826 }
float RandWiggleFloat()
Helper to get a randomized wiggle float value.
Definition Particle.c:831

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

Используется в RandomizeOrientation() и ParticleSource::RandomizeOrientation().

◆ ScaleParticleParam()

void ScaleParticleParam ( int parameter_id,
float coef )
inlineprivate

Scales the given parameter on all emitors relatively to their CURRENT value.

Аргументы
parameter_idint The parameter to adjust (enum EmitorParam)
coeffloat The multiplier to apply
688 {
689 if (!m_ParticleEffect)
690 return;
691
693 for (int i = 0; i < emitors; ++i)
694 {
695 float value;
698 }
699 }

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParm(), m_ParticleEffect и SetParticleParm().

◆ ScaleParticleParamFromOriginal()

void ScaleParticleParamFromOriginal ( int parameter_id,
float coef )
inlineprivate

Scales the given parameter on all emitors relatively to their ORIGINAL value.

Аргументы
parameter_idint The parameter to adjust (enum EmitorParam)
coeffloat The multiplier to apply
669 {
670 if (!m_ParticleEffect)
671 return;
672
674 for (int i = 0; i < emitors; ++i)
675 {
676 float value;
679 }
680 }

Перекрестные ссылки GetParticleEmitorCount(), GetParticleParmOriginal(), m_ParticleEffect и SetParticleParm().

Используется в BroomBase::UpdateParticle() и FlammableBase::UpdateParticle().

◆ SetParameter()

void SetParameter ( int emitter,
int parameter,
float value )
inlineprivate

Set the value of a parameter of an emitor in the particle.

Аргументы
emitterint The emitter to apply the new value to, -1 for all emitter
parameterint The parameter to apply the new value to (enum EmitorParam)
valuefloat The value to apply
626 {
627 if (!m_ParticleEffect)
628 return;
629
631 }

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

Используется в ManBase::ContaminatedParticleAdjustment(), CreateParticle(), DestroyParticleEffect(), ParticleNormalSmokeStart(), ParticleSmallSmokeStart(), PlayVFX(), ManBase::SetContaminatedEffectEx(), FlareSimulation::Simulate() и FlareSimulation::TurnOffDistantLight().

◆ SetParticleParam()

void SetParticleParam ( int parameter_id,
float value )
inlineprivate

Set the value of a parameter of all emitors in the particle.

Аргументы
parameterint The parameter to apply the new value to (enum EmitorParam)
valuefloat The value to apply
612 {
613 if (!m_ParticleEffect)
614 return;
615
617 }

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

◆ SetSource()

void SetSource ( int particle_id)
inlineprotected

Sets particle id.

Заметки
Does not work at runtime, particle object needs to be destroyed and then Particle needs to play again
Аргументы
particle_idint Particle ID registered in ParticleList to start playing
286 {
288 }

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

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

◆ SetWiggle()

void SetWiggle ( float random_angle,
float random_interval )
inlineprivate

Makes the particle change direction by random_angle every random_interval seconds.

Заметки
This does not actually work on Particle with no parent, it should on ParticleSource
Calling SetWiggle(0,0) will effectively stop all wiggle functionality
Аргументы
random_anglefloat Will be the range [-random_angle, random_angle[ to wiggle between
random_intervalfloat Will be the time range [0, random_interval] to wiggle next time
766 {
767 if ( random_angle != 0 || random_interval != 0 )
768 {
771
772 if ( !m_RandomizeOri )
774
775 if ( !m_RandomizeOri.IsRunning() ) // Makes sure the timer is NOT running already
776 m_RandomizeOri.Run( Math.RandomFloat(0, m_MaxOriInterval) , this, "RandomizeOrientation", null, false);
777 }
778 else
779 {
780 StopWiggle();
781 }
782 }
void StopWiggle()
Stops randomized wiggle.
Definition Particle.c:787
Definition DayZPlayerImplement.c:63
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, m_MaxOriInterval, m_MaxOriWiggle, m_RandomizeOri, Math::RandomFloat() и StopWiggle().

Используется в FlareSimulation::OnActivation(), CupidsBoltSimulation::OnFire(), SmokeSimulation::OnFire(), Ammo_40mm_Smoke_ColorBase::OnVariablesSynchronized(), PlayVFX() и Roadflare::UpdateActiveParticles().

◆ Stop()

◆ StopParticle()

override bool StopParticle ( int flags = 0)
inlineprotected

Method to tell the particle to stop playing.

Заметки
No flags available for Particle
Emitors are automatically removed later when its particle count is 0
Аргументы
flagsint Flags to pass to the stopping (None on this level)
Возвращает
bool Whether the particle successfully stopped
246 {
248
249 // Without the following we might get an error when a particle parent is despawned client-side.
250 Object parent = Object.Cast( GetParent() );
251 if ( parent && !ToDelete())
252 {
254 parent.RemoveChild(this);
256 }
257
258 UpdateState();
259
260 return true;
261 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:405

Перекрестные ссылки GetParent(), GetPosition, OnParticleStop(), SetPosition() и UpdateState().

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

◆ StopWiggle()

void StopWiggle ( )
inlineprivate

Stops randomized wiggle.

788 {
789 if ( m_RandomizeOri )
790 {
791 m_RandomizeOri.Stop();
792 }
793
794 m_MaxOriWiggle = 0;
796 }

Перекрестные ссылки m_MaxOriInterval, m_MaxOriWiggle и m_RandomizeOri.

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

◆ UpdateState()

void UpdateState ( )
inlineprotected

Creates/Destroys ParticleEffect child according to current state.

Заметки
Is called from Play/Stop methods
426 {
427 if ( m_IsPlaying == false && m_ParticleEffect)
428 {
430 }
431 else if ( m_IsPlaying == true && m_ParticleEffect == null )
432 {
434 }
435 }
void DestroyParticleEffect()
Destroys ParticleEffect child, called from UpdateState.
Definition Particle.c:474
void CreateParticleEffect()
Creates ParticleEffect child, called from UpdateState.
Definition Particle.c:440

Перекрестные ссылки CreateParticleEffect(), DestroyParticleEffect(), m_IsPlaying и m_ParticleEffect.

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

Поля

◆ m_DefaultOri

vector m_DefaultOri
private

◆ m_DefaultPos

vector m_DefaultPos
private

◆ m_DefaultWorldOri

vector m_DefaultWorldOri
private

Used for Wiggle API, to restore after unparenting.

Используется в ParticleSource::OnParticleUnParented() и ParticleSource::SetWiggle().

◆ m_DefaultWorldPos

vector m_DefaultWorldPos
private

Used for Wiggle API, to restore after unparenting.

Используется в ParticleSource::OnParticleUnParented() и ParticleSource::SetWiggle().

◆ m_ForceOrientationRelativeToWorld

bool m_ForceOrientationRelativeToWorld
private

Used for Wiggle API, to restore after unparenting.

Используется в AddAsChild(), CreateParticleEffect(), ParticleSource::RandomizeOrientation(), ParticleSource::SetWiggle() и ParticleSource::StopWiggle().

◆ m_GlobalPosPreviousFrame

vector m_GlobalPosPreviousFrame
private

DEPRECATED.

◆ m_IsRepeat

bool m_IsRepeat
protected

Whether this particle repeats.

Используется в CreateParticleEffect(), DestroyParticleEffect() и OnCheckAutoDelete().

◆ m_Lifetime

float m_Lifetime
protected

Approx. remaining lifetime of particle.

Используется в CreateParticleEffect(), EOnFrame() и OnCheckAutoDelete().

◆ m_MarkedForDeletion

bool m_MarkedForDeletion
private

Whether this particle is queued for deletion.

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

◆ m_MaxOriInterval

float m_MaxOriInterval
private

Used for Wiggle API, Interval for wiggling [0, m_MaxOriInterval[.

Используется в ParticleSource::OnParticleUnParented(), RandomizeOrientation(), ParticleSource::RandomizeOrientation(), SetWiggle(), ParticleSource::SetWiggle() и StopWiggle().

◆ m_MaxOriWiggle

float m_MaxOriWiggle
private

Used for Wiggle API, Wiggle room [-m_MaxOriWiggle, m_MaxOriWiggle].

Используется в ParticleSource::OnParticleUnParented(), RandWiggleFloat(), SetWiggle(), ParticleSource::SetWiggle() и StopWiggle().

◆ m_ParentObject

◆ m_ParticleEffect

◆ m_ParticleID

int m_ParticleID
protected

ID from ParticleList if assigned.

Используется в CreateParticleEffect(), GetParticleID() и SetSource().

◆ m_PreviousFrame

int m_PreviousFrame
protected

DEPRECATED.

◆ m_RandomizeOri

ref Timer m_RandomizeOri
private

Used for Wiggle API, calls the Wiggle functionality.

Используется в IsWiggling(), ParticleSource::OnParticleStop(), RandomizeOrientation(), ParticleSource::RandomizeOrientation(), SetWiggle() и StopWiggle().

◆ m_WiggleProcessing

bool m_WiggleProcessing
private

Used for Wiggle API, to signal that wiggle API is currently doing work.

Используется в ParticleSource::OnParticleUnParented(), RandomizeOrientation() и ParticleSource::RandomizeOrientation().

◆ MAX_EMITORS

const int MAX_EMITORS = 30
staticprivate

DEPRECATED


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