DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ParticleSource

Entity which has the particle instance as an ObjectComponent. Подробнее...

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

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

void ParticleInit ()
 Empty - Only needed for Particle.
 
proto native void SetParticleAutoDestroyFlags (ParticleAutoDestroyFlags flags)
 Enables the particle to automatically clean up itself when ending or stopping.
 
void DisableAutoDestroy ()
 Disables the particle automatically cleaning up itself when ending or stopping.
 
proto native int GetParticleAutoDestroyFlags ()
 Gets the currently set ParticleAutoDestroyFlags flags set on this ParticleSource.
 
Events

ParticleBase events For ParticleSource, these are handed on C++ side For more information, read ParticleEvents

void OnParticleParented (IEntity parent)
 Event when the particle receives a parent.
 
void OnParticleUnParented (IEntity parent)
 Event when the particle is orphaned.
 
void OnParticleStop ()
 Event when the particle stops.
 
Misc backwards compatibility helpers

Helpers for misc backwards compatibility functionality

override 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

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

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

Create a particle (static)

Helper static methods to create/attach/play a ParticleSource on one line

static ParticleSource CreateParticle (int id, vector pos, bool playOnCreation=false, Object parent=null, vector ori=vector.Zero, bool forceWorldRotation=false, Class owner=null)
 Create function.
 
static ParticleSource CreateParticleEx (int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null)
 Master create function.
 
static override 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 override 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 override 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 override ParticleSource 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 override 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 override 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 override Particle PlayInWorld (int particle_id, vector global_pos)
 Creates a particle emitter on the given position and activates it.
 
static override Particle Play (int particle_id, vector global_pos)
 Legacy function for backwards compatibility with 1.01 and below.
 

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

void ParticleSource ()
 ctor
 
void ~ParticleSource ()
 dtor
 
Playback

Methods regarding playing/stopping of particle

proto bool PlayParticleNative (int flags)
 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.
 
proto bool StopParticleNative (int flags)
 Method to tell the particle to stop playing.
 
override bool StopParticle (int flags=0)
 Method to tell the particle to stop playing.
 
proto native bool ResetParticleNative ()
 Method to tell the particle to reset.
 
override bool ResetParticle ()
 Method to tell the particle to reset.
 
proto native bool RestartParticleNative ()
 Method to tell the particle to restart (reset + play)
 
override bool RestartParticle ()
 Method to tell the particle to restart (reset + play)
 
proto bool IsParticlePlayingNative ()
 Ask if the particle is still playing.
 
override bool IsParticlePlaying ()
 Ask if the particle is still playing.
 
SetParticle

Methods that set the particle to be used

proto native bool SetParticleNative (string path)
 Assigns a particle to the ParticleSource.
 
bool SetParticle (string path)
 Assigns a particle to the ParticleSource.
 
bool SetParticleByID (int id)
 Assigns a particle to the ParticleSource.
 
override void SetSource (int particle_id)
 Sets particle id.
 
GetParticle

Methods that get the particle assigned

proto bool GetParticleNative (out string path, EGetParticleMode mode)
 Gets the path to the currently assigned particle.
 
bool GetParticle (out string path, EGetParticleMode mode)
 Gets the path to the currently assigned particle.
 
override int GetParticleID ()
 Gets the ParticleList ID of the currently assigned particle.
 
int GetParticleIDLegacy ()
 Gets the ParticleList ID of the currently assigned particle.
 
Apply properties

Methods to apply properties to the particle

proto native bool ApplyPropertiesNative (ParticleProperties properties)
 Applies the properties given to the ParticleSource.
 
bool ApplyProperties (ParticleProperties properties)
 Applies the properties given to the ParticleSource

 
Properties and state

Obtain information or set properties regarding the state of the Particle

override Object GetDirectParticleEffect ()
 Returns direct particle effect entity.
 
override Object GetParticleParent ()
 Returns the parent of this Particle if there is one.
 
proto bool HasActiveParticleNative ()
 Returns if there is any particle active.
 
override bool HasActiveParticle ()
 Returns if there is any particle active.
 
proto int GetParticleCountNative ()
 Returns the total count of active particles in all emitors.
 
override int GetParticleCount ()
 Returns the total count of active particles in all emitors.
 
proto bool IsRepeatNative ()
 Returns whether there is a repeating particle.
 
override bool IsRepeat ()
 Returns whether there is a repeating particle.
 
proto float GetMaxLifetimeNative ()
 Returns the approx. max lifetime.
 
override float GetMaxLifetime ()
 Returns the approx. max lifetime.
 
proto native Class GetOwner ()
 Get the owner of this ParticleSource.
 
proto native void SetOwner (Class owner)
 Set the owner of this ParticleSource.
 
proto native void Orphan ()
 null the owner of this ParticleSource
 
Owning ParticleManager

Methods regarding the owner

proto native ParticleManager GetParticleManager ()
 Get the ParticleManager the ParticleSource belongs to if any.
 
proto native int GetIndex ()
 Get the index of this ParticleSource in the owning ParticleManager.
 
- Закрытые члены унаследованные от 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.
 
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.
 
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.
 
void UpdateState ()
 Creates/Destroys ParticleEffect child according to current state.
 

Static counter API

Gives counter information for the class

proto int GetCountID ()
 Gets the ID for the ParticleSource.
 
proto static native int GetStaticCount ()
 Gets the amount of ParticleSource that have been created since the start of the program.
 
proto static native int GetStaticActiveCount ()
 Gets the amount of ParticleSource that are currently existing.
 

Wiggle API

Settings to make the Particle wiggle

void RandomizeOrientation ()
 Randomizes a new orientation and applies it.
 
override void SetWiggle (float random_angle, float random_interval)
 Makes the particle change direction by random_angle every random_interval seconds.
 
override void StopWiggle ()
 Stops randomized wiggle.
 

Misc Particle specific helpers

Functionality specific for Particle, so we empty them here

void UpdateState ()
 Empty.
 
void DestroyParticleEffect ()
 Empty.
 
void CreateParticleEffect ()
 Empty.
 
void OnCheckAutoDelete ()
 Empty.
 
void OnToDelete ()
 Empty.
 
void EOnFrame (IEntity other, float timeSlice)
 Empty.
 

Дополнительные унаследованные члены

- Закрытые статические члены унаследованные от Particle
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 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.
 
- Закрытые данные унаследованные от Particle
int m_ParticleID
 ID from ParticleList if assigned.
 
float m_Lifetime
 Approx. remaining lifetime of particle.
 
bool m_IsRepeat
 Whether this particle repeats.
 
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.
 

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

Entity which has the particle instance as an ObjectComponent.

Заметки
Unfortunately the native methods are private and have a script wrapper This is because of backwards compatibility with the old Particle and to avoid confusion As we should continue to use Particle for consistency, as it is too deeply rooted in script Which means switching is no longer possible due to it being harmful for already existing mods Even though using the ParticleSource directly would be preferred
Some variables from Particle are invalid on this level, those marked DEPRECATED by Particle are still DEPRECATED here m_ParticleID; //!< INVALID - Use GetParticleID() instead m_Lifetime; //!< INVALID - No EOnFrame, so no use for it m_IsPlaying; //!< VALID - Set through events - IsParticlePlaying() is still better m_IsRepeat; //!< INVALID - Use IsRepeat() instead m_MarkedForDeletion; //!< INVALID - No EOnFrame, so no use for it Wiggle API variables are still used for Wiggle API m_ParentObject; //!< VALID - Set through events - Or use GetParticleParent() or GetParent() m_ParticleEffect; //!< VALID - Not in the same usage as Particle, as it will always be 'this', never null

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

◆ ParticleSource()

void ParticleSource ( )
inlineprivate

ctor

127 {
128 m_ParticleEffect = this;
129 }
Object m_ParticleEffect
The child object which contains the actual particle.
Definition Particle.c:50

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

◆ ~ParticleSource()

void ~ParticleSource ( )
inlineprivate

dtor

133 {
134 }

Методы

◆ AddAsChild()

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

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

Заметки
Unlike Particle, you are free to use AddChild/RemoveChild instead of this one if you know what you are doing
Аргументы
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)
784 {
785 int flags = ParticlePropertiesFlags.NONE;
786
788 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
789
790 ParticleProperties props = new ParticleProperties(local_pos, flags, parent, local_ori);
792 }
Definition EntityAI.c:95
bool ApplyProperties(ParticleProperties properties)
Applies the properties given to the ParticleSource
Definition ParticleSource.c:547

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

◆ ApplyProperties()

bool ApplyProperties ( ParticleProperties properties)
inlineprivate

Applies the properties given to the ParticleSource

Аргументы
propertiesParticleProperties The properties to apply
Возвращает
bool Whether the properties were successfully applied
548 {
550 }
proto native bool ApplyPropertiesNative(ParticleProperties properties)
Applies the properties given to the ParticleSource.

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

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

◆ ApplyPropertiesNative()

proto native bool ApplyPropertiesNative ( ParticleProperties properties)
private

Applies the properties given to the ParticleSource.

Заметки
Already handles proper reparenting
Аргументы
propertiesParticleProperties The properties to apply
Возвращает
bool Whether the properties were successfully applied

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

◆ Create() [1/2]

static override 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.

250 {
252 }
int particle_id
Definition SmokeSimulation.c:28
static override 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 ParticleSource.c:236

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

◆ Create() [2/2]

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

Legacy function for backwards compatibility with 1.01 and below.

271 {
273 }
static override 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 ParticleSource.c:262

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

◆ CreateInWorld()

static override 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 Has absolutely no effect here as there is no parent
Возвращает
Particle Created particle instance
263 {
265 }
void CreateParticle()
Definition BleedingSource.c:83

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

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

◆ CreateOnObject()

static override 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, 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

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

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

◆ CreateParticle()

static ParticleSource CreateParticle ( int id,
vector pos,
bool playOnCreation = false,
Object parent = null,
vector ori = vector.Zero,
bool forceWorldRotation = false,
Class owner = null )
inlinestaticprotected

Create function.

Аргументы
idint Particle ID registered in ParticleList
posvector Position of ParticleSource in LS (WS when no parent)
playOnCreationbool Whether to play immediately after creation (Optional)
parentObject Parent Object which will child the ParticleSource (Optional)
orivector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional)
forceWorldRotationbool Forces orientation to rotate relative to the world and not with the parent (Optional)
ownerClass The owning instance for this particle (Optional)
Возвращает
ParticleSource Created particle instance when successful
179 {
180 int flags = ParticlePropertiesFlags.NONE;
181
182 if (playOnCreation)
183 {
184 flags = flags | ParticlePropertiesFlags.PLAY_ON_CREATION;
185 }
186
188 {
189 flags = flags | ParticlePropertiesFlags.FORCE_WORLD_ROT;
190 }
191
192 return CreateParticleEx(id, pos, flags, parent, ori, owner);
193 }
static ParticleSource CreateParticleEx(int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null)
Master create function.
Definition ParticleSource.c:205

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

Используется в PMTPlayback::TestOnePlayingStandAlone(), PMTPlayback::TestOnePlayingStandAloneAutoDestroy(), PMTPlayback::TestStopping() и PMTPlayback::TestWiggleStress().

◆ CreateParticleEffect()

void CreateParticleEffect ( )
inlineprivate

Empty.

1019{ ErrorEx("Should not be in use on ParticleSource."); }
enum ShapeType ErrorEx

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

◆ CreateParticleEx()

static ParticleSource CreateParticleEx ( int id,
vector pos,
int flags = ParticlePropertiesFlags.NONE,
Object parent = null,
vector ori = vector.Zero,
Class owner = null )
inlinestaticprotected

Master create function.

Аргументы
idint Particle ID registered in ParticleList
posvector Position of ParticleSource in LS (WS when no parent)
flagsint See ParticlePropertiesFlags (Optional)
parentObject Parent Object which will child the ParticleSource (Optional)
orivector Orientation of ParticleSource in LS (WS when no parent) (Pitch, Yaw, Roll in degrees) (Optional)
ownerClass The owning instance for this particle (Optional)
Возвращает
ParticleSource Created particle instance when successful
206 {
208 if (particlePath == "") // There is already an error inside of ParticleList signaling this
209 {
210 ErrorEx(string.Format("Could not create ParticleSource as particle id %1 is invalid.", id));
211 return null;
212 }
213
214 vector localPos = pos;
215
216 if (parent)
217 pos = parent.GetPosition();
218
219 ParticleSource p = ParticleSource.Cast( GetGame().CreateObjectEx("ParticleSource", pos, ECE_LOCAL) );
220 p.SetParticle(particlePath);
221 ParticleProperties props = new ParticleProperties(localPos, flags, parent, ori, owner);
222 p.ApplyProperties(props);
223
224 return p;
225 }
const int ECE_LOCAL
Definition CentralEconomy.c:24
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:468
Entity which has the particle instance as an ObjectComponent.
Definition ParticleSource.c:124
Definition EnConvert.c:106
proto native CGame GetGame()

Перекрестные ссылки ECE_LOCAL, ErrorEx, GetGame() и ParticleList::GetParticleFullPath().

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

◆ DestroyParticleEffect()

void DestroyParticleEffect ( )
inlineprivate

Empty.

1016{ ErrorEx("Should not be in use on ParticleSource."); }

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

◆ DisableAutoDestroy()

void DisableAutoDestroy ( )
inlineprotected

Disables the particle automatically cleaning up itself when ending or stopping.

152 {
154 }
ParticleAutoDestroyFlags
Flags to pass to ParticleSource.SetParticleAutoDestroyFlags.
Definition ParticleSource.c:3
proto native void SetParticleAutoDestroyFlags(ParticleAutoDestroyFlags flags)
Enables the particle to automatically clean up itself when ending or stopping.

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

◆ EOnFrame()

void EOnFrame ( IEntity other,
float timeSlice )
inlineprotected

Empty.

1022{ ErrorEx("Should not be in use on ParticleSource."); }

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

◆ GetCountID()

proto int GetCountID ( )
private

Gets the ID for the ParticleSource.

Заметки
Different every restart, as it is the nth instance created since the start of the program
Возвращает
int ID for the ParticleSource

◆ GetDirectParticleEffect()

override Object GetDirectParticleEffect ( )
inlineprivate

Returns direct particle effect entity.

Заметки
Backwards compatibility with Particle, here it is the Object itself
Возвращает
Object The Object with the particle component (this)
567 {
568 return this;
569 }

◆ GetIndex()

proto native int GetIndex ( )
private

Get the index of this ParticleSource in the owning ParticleManager.

Возвращает
int The index in the pool in the owning ParticleManager, -1 if no owner

◆ GetMaxLifetime()

override float GetMaxLifetime ( )
inlineprivate

Returns the approx. max lifetime.

Возвращает
float The largest lifetime sum among the emitors
638 {
639 return GetMaxLifetimeNative();
640 }
proto float GetMaxLifetimeNative()
Returns the approx. max lifetime.

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

◆ GetMaxLifetimeNative()

proto float GetMaxLifetimeNative ( )
private

Returns the approx. max lifetime.

Возвращает
float The largest lifetime sum among the emitors

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

◆ GetOwner()

proto native Class GetOwner ( )
private

Get the owner of this ParticleSource.

Возвращает
Class The owner or null

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

◆ GetParameter()

override void GetParameter ( int emitter,
int parameter,
out float value )
inlineprotected

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
831 {
833 }
proto void GetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)

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

◆ GetParameterEx()

override float GetParameterEx ( int emitter,
int parameter )
inlineprotected

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
842 {
843 float value;
845 return value;
846 }

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

◆ GetParticle()

bool GetParticle ( out string path,
EGetParticleMode mode )
inlineprivate

Gets the path to the currently assigned particle.

Аргументы
pathstring Path of particle effect
modeEGetParticleMode What path to return
Возвращает
bool Whether the path is filled in or not
493 {
494 return GetParticleNative(path, mode);
495 }
string path
Definition OptionSelectorMultistate.c:142
proto bool GetParticleNative(out string path, EGetParticleMode mode)
Gets the path to the currently assigned particle.

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

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

◆ GetParticleAutoDestroyFlags()

proto native int GetParticleAutoDestroyFlags ( )
protected

Gets the currently set ParticleAutoDestroyFlags flags set on this ParticleSource.

Возвращает
int Currently set ParticleAutoDestroyFlags flags set on this ParticleSource

◆ GetParticleCount()

override int GetParticleCount ( )
inlineprivate

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
608 {
609 return GetParticleCountNative();
610 }
proto int GetParticleCountNative()
Returns the total count of active particles in all emitors.

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

◆ GetParticleCountNative()

proto int GetParticleCountNative ( )
private

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

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

◆ GetParticleID()

override int GetParticleID ( )
inlineprivate

Gets the ParticleList ID of the currently assigned particle.

Возвращает
int ID of particle registered in ParticleList
502 {
503 string path;
506 else
507 return -1;
508 }
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)
Definition ParticleList.c:483
bool GetParticle(out string path, EGetParticleMode mode)
Gets the path to the currently assigned particle.
Definition ParticleSource.c:492

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

◆ GetParticleIDLegacy()

int GetParticleIDLegacy ( )
inlineprivate

Gets the ParticleList ID of the currently assigned particle.

Заметки
This is because the new GetParticleID will only work when every particle file name has a unique name In case this is not the case, then this method is what one will want to use
Возвращает
int ID of particle registered in ParticleList
517 {
518 string path;
519 if (GetParticle(path, EGetParticleMode.NO_EXT))
521 else
522 return -1;
523 }
static int GetParticleID(string particle_file)
Returns particle's ID based on the path (without .ptc suffix)
Definition ParticleList.c:474

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

◆ GetParticleManager()

proto native ParticleManager GetParticleManager ( )
private

Get the ParticleManager the ParticleSource belongs to if any.

Возвращает
ParticleManager The ParticleManager which created the ParticleSource or null

◆ GetParticleNative()

proto bool GetParticleNative ( out string path,
EGetParticleMode mode )
private

Gets the path to the currently assigned particle.

Аргументы
pathstring Path of particle effect
modeEGetParticleMode What path to return
Возвращает
bool Whether the path is filled in or not

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

◆ GetParticleParent()

override Object GetParticleParent ( )
inlineprivate

Returns the parent of this Particle if there is one.

Возвращает
Object The parent or null if there is none
576 {
577 return Object.Cast(GetParent());
578 }
Definition ObjectTyped.c:2
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:407

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

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

◆ GetStaticActiveCount()

proto static native int GetStaticActiveCount ( )
staticprivate

Gets the amount of ParticleSource that are currently existing.

Возвращает
int Amount of ParticleSource that are currently existing

Используется в PMTF::PrintActiveStats() и TestCleanup().

◆ GetStaticCount()

proto static native int GetStaticCount ( )
staticprivate

Gets the amount of ParticleSource that have been created since the start of the program.

Возвращает
int Amount of ParticleSource that have been created since the start of the program

◆ HasActiveParticle()

override bool HasActiveParticle ( )
inlineprivate

Returns if there is any particle active.

Возвращает
bool Whether there is any particle active
591 {
593 }
proto bool HasActiveParticleNative()
Returns if there is any particle active.

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

◆ HasActiveParticleNative()

proto bool HasActiveParticleNative ( )
private

Returns if there is any particle active.

Возвращает
bool Whether there is any particle active

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

◆ IncrementParticleParam()

override void IncrementParticleParam ( int parameter_id,
float value )
inlineprotected

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
904 {
905 int emitors = GetParticleEmitorCount(this);
906 for (int i = 0; i < emitors; ++i)
907 {
908 float param;
911 }
912 }
proto void SetParticleParm(notnull IEntity ent, int emitor, EmitorParam parameter, void value)
proto int GetParticleEmitorCount(notnull IEntity ent)

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

Используется в HotSpringTrigger::SpawnVaporEffect() и VolcanicTrigger::SpawnVaporEffect().

◆ IncrementParticleParamFromOriginal()

override void IncrementParticleParamFromOriginal ( int parameter_id,
float value )
inlineprotected

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
887 {
888 int emitors = GetParticleEmitorCount(this);
889 for (int i = 0; i < emitors; ++i)
890 {
891 float param;
894 }
895 }
proto void GetParticleParmOriginal(notnull IEntity ent, int emitor, EmitorParam parameter, out void value)

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

◆ IsParticlePlaying()

override bool IsParticlePlaying ( )
inlineprivate

Ask if the particle is still playing.

Возвращает
bool Whether the particle is playing
418 {
420 }
proto bool IsParticlePlayingNative()
Ask if the particle is still playing.

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

◆ IsParticlePlayingNative()

proto bool IsParticlePlayingNative ( )
private

Ask if the particle is still playing.

Возвращает
bool Whether the particle is playing

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

◆ IsRepeat()

override bool IsRepeat ( )
inlineprivate

Returns whether there is a repeating particle.

Возвращает
bool whether there is a repeating particle
623 {
624 return IsRepeatNative();
625 }
proto bool IsRepeatNative()
Returns whether there is a repeating particle.

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

◆ IsRepeatNative()

proto bool IsRepeatNative ( )
private

Returns whether there is a repeating particle.

Возвращает
bool whether there is a repeating particle

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

◆ OnCheckAutoDelete()

void OnCheckAutoDelete ( )
inlineprivate

Empty.

1025{ ErrorEx("Should not be in use on ParticleSource."); }

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

◆ OnParticleParented()

void OnParticleParented ( IEntity parent)
inlineprotected

Event when the particle receives a parent.

723 {
724 m_ParentObject = Object.Cast(parent);
725
726 super.OnParticleParented(parent);
727 }
Object m_ParentObject
Parent Object the Particle is child of.
Definition Particle.c:48

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

◆ OnParticleStop()

void OnParticleStop ( )
inlineprotected

Event when the particle stops.

756 {
757 if (IsWiggling())
758 {
759 StopWiggle();
760 delete m_RandomizeOri;
761 }
762
763 super.OnParticleStop();
764 }
bool IsWiggling()
Checks if particle is currently wiggling.
Definition Particle.c:763
ref Timer m_RandomizeOri
Used for Wiggle API, calls the Wiggle functionality.
Definition Particle.c:44
override void StopWiggle()
Stops randomized wiggle.
Definition ParticleSource.c:960

Перекрестные ссылки Particle::IsWiggling(), Particle::m_RandomizeOri и StopWiggle().

◆ OnParticleUnParented()

void OnParticleUnParented ( IEntity parent)
inlineprotected

Event when the particle is orphaned.

733 {
735
736 // Since we have lost the parent, we will need to refresh the wiggle
737 // As it uses a cached local position, which is now no longer correct
739 {
744
745 StopWiggle();
747 }
748
749 super.OnParticleUnParented(parent);
750 }
float m_MaxOriWiggle
Used for Wiggle API, Wiggle room [-m_MaxOriWiggle, m_MaxOriWiggle].
Definition Particle.c:40
vector m_DefaultOri
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:31
vector m_DefaultPos
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:33
bool m_WiggleProcessing
Used for Wiggle API, to signal that wiggle API is currently doing work.
Definition Particle.c:27
vector m_DefaultWorldPos
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:37
float m_MaxOriInterval
Used for Wiggle API, Interval for wiggling [0, m_MaxOriInterval[.
Definition Particle.c:42
vector m_DefaultWorldOri
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:35
override void SetWiggle(float random_angle, float random_interval)
Makes the particle change direction by random_angle every random_interval seconds.
Definition ParticleSource.c:929

Перекрестные ссылки Particle::IsWiggling(), Particle::m_DefaultOri, Particle::m_DefaultPos, Particle::m_DefaultWorldOri, Particle::m_DefaultWorldPos, Particle::m_MaxOriInterval, Particle::m_MaxOriWiggle, Particle::m_ParentObject, Particle::m_WiggleProcessing, SetWiggle() и StopWiggle().

◆ OnToDelete()

void OnToDelete ( )
inlineprivate

Empty.

1028{ ErrorEx("Should not be in use on ParticleSource."); }

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

◆ Orphan()

proto native void Orphan ( )
private

null the owner of this ParticleSource

◆ ParticleInit()

void ParticleInit ( )
inlineprotected

Empty - Only needed for Particle.

137{}

◆ Play() [1/2]

static override 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.

302 {
304 }
static override 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 ParticleSource.c:293

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

◆ Play() [2/2]

static override Particle Play ( int particle_id,
vector global_pos )
inlinestaticprotected

Legacy function for backwards compatibility with 1.01 and below.

321 {
323 }
static override Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Definition ParticleSource.c:312

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

◆ PlayInWorld()

static override 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
313 {
315 }

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

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

◆ PlayOnObject()

static override 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

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

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

◆ PlayParticleEx()

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

Method to tell the particle to start playing.

Аргументы
particle_idint Particle ID registered in ParticleList to start playing
Возвращает
bool Whether the particle successfully started
347 {
348 if ( particle_id > -1 )
349 {
350 // Here we can just do it directly
351 // While with the old system it will not work when the particle is already created
353 }
354
355 return PlayParticleNative(flags);
356 }
proto bool PlayParticleNative(int flags)
Method to tell the particle to start playing.
bool SetParticleByID(int id)
Assigns a particle to the ParticleSource.
Definition ParticleSource.c:454

Перекрестные ссылки particle_id, PlayParticleNative() и SetParticleByID().

◆ PlayParticleNative()

proto bool PlayParticleNative ( int flags)
private

Method to tell the particle to start playing.

Заметки
Will call OnParticleStart when successful
Возвращает
bool Whether the particle successfully started

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

◆ RandomizeOrientation()

void RandomizeOrientation ( )
inlineprivate

Randomizes a new orientation and applies it.

983 {
984 if (ToDelete())
985 return;
986
987 m_WiggleProcessing = true;
988
989 if ( !m_RandomizeOri.IsRunning() )
990 m_RandomizeOri.Run( Math.RandomFloat(0, m_MaxOriInterval) , this, "RandomizeOrientation", null, false);
991
992 int flags = ParticlePropertiesFlags.NONE;
993
995 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
996
997 ParticleProperties prop = new ParticleProperties(m_DefaultPos, flags, GetParticleParent(), m_DefaultOri + RandWiggleVector(), GetOwner());
999
1000 m_WiggleProcessing = false;
1001 }
Definition EnMath.c:7
bool m_ForceOrientationRelativeToWorld
Used for Wiggle API, to restore after unparenting.
Definition Particle.c:29
vector RandWiggleVector()
Helper to get a randomized wiggle vector.
Definition Particle.c:833
proto native Class GetOwner()
Get the owner of this ParticleSource.
override Object GetParticleParent()
Returns the parent of this Particle if there is one.
Definition ParticleSource.c:575
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки ApplyProperties(), GetOwner(), GetParticleParent(), Particle::m_DefaultOri, Particle::m_DefaultPos, Particle::m_ForceOrientationRelativeToWorld, Particle::m_MaxOriInterval, Particle::m_RandomizeOri, Particle::m_WiggleProcessing, Math::RandomFloat() и Particle::RandWiggleVector().

◆ ResetParticle()

override bool ResetParticle ( )
inlineprivate

Method to tell the particle to reset.

Возвращает
bool Whether the particle successfully reset
388 {
389 return ResetParticleNative();
390 }
proto native bool ResetParticleNative()
Method to tell the particle to reset.

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

◆ ResetParticleNative()

proto native bool ResetParticleNative ( )
private

Method to tell the particle to reset.

Возвращает
bool Whether the particle successfully reset

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

◆ RestartParticle()

override bool RestartParticle ( )
inlineprivate

Method to tell the particle to restart (reset + play)

Возвращает
bool Whether the particle successfully restarted
403 {
404 return RestartParticleNative();
405 }
proto native bool RestartParticleNative()
Method to tell the particle to restart (reset + play)

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

◆ RestartParticleNative()

proto native bool RestartParticleNative ( )
private

Method to tell the particle to restart (reset + play)

Возвращает
bool Whether the particle successfully restarted

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

◆ ScaleParticleParam()

override void ScaleParticleParam ( int parameter_id,
float coef )
inlineprotected

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
870 {
871 int emitors = GetParticleEmitorCount(this);
872 for (int i = 0; i < emitors; ++i)
873 {
874 float value;
876 SetParticleParm(this, i, parameter_id, value * coef);
877 }
878 }

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

◆ ScaleParticleParamFromOriginal()

override void ScaleParticleParamFromOriginal ( int parameter_id,
float coef )
inlineprotected

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
854 {
855 int emitors = GetParticleEmitorCount(this);
856 for (int i = 0; i < emitors; ++i)
857 {
858 float value;
860 SetParticleParm(this, i, parameter_id, value * coef);
861 }
862 }

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

◆ SetOwner()

proto native void SetOwner ( Class owner)
private

Set the owner of this ParticleSource.

Аргументы

p Class The owner or null

Используется в FireworksLauncherClientEvent::OnFired(), FireworksLauncher::OnFuseIgnitedClient() и DestructionEffectBase::OnHealthLevelChanged().

◆ SetParameter()

override void SetParameter ( int emitter,
int parameter,
float value )
inlineprotected

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
820 {
822 }

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

◆ SetParticle()

bool SetParticle ( string path)
inlineprivate

Assigns a particle to the ParticleSource.

Заметки
Intentionally private, as it is best to use 'SetParticleByID' instead from script, because ParticleList
Аргументы
pathstring Path of particle effect
Возвращает
bool Whether the creating and assigning of particle was successful
445 {
446 return SetParticleNative(path);
447 }
proto native bool SetParticleNative(string path)
Assigns a particle to the ParticleSource.

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

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

◆ SetParticleAutoDestroyFlags()

proto native void SetParticleAutoDestroyFlags ( ParticleAutoDestroyFlags flags)
protected

Enables the particle to automatically clean up itself when ending or stopping.

Заметки
Is enabled by default (ALL)
Looping particles never end
ParticleSource belonging to a ParticleManager will ignore these
Аргументы
flagsParticleAutoDestroyFlags Flags enabling when the particle should be auto destroyed

Используется в DisableAutoDestroy() и Edible_Base::UpdateVaporParticle().

◆ SetParticleByID()

bool SetParticleByID ( int id)
inlineprivate

Assigns a particle to the ParticleSource.

Аргументы
idint ID of particle registered in ParticleList
Возвращает
bool Whether the creating and assigning of particle was successful
455 {
457 }
bool SetParticle(string path)
Assigns a particle to the ParticleSource.
Definition ParticleSource.c:444

Перекрестные ссылки ParticleList::GetParticleFullPath() и SetParticle().

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

◆ SetParticleNative()

proto native bool SetParticleNative ( string path)
private

Assigns a particle to the ParticleSource.

Аргументы
pathstring Path of particle effect
Возвращает
bool Whether the creating and assigning of particle was successful

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

◆ SetParticleParam()

override void SetParticleParam ( int parameter_id,
float value )
inlineprotected

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
809 {
811 }

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

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

◆ SetSource()

override void SetSource ( int particle_id)
inlineprivate

Sets particle id.

Заметки
Purely here for backwards compatibility with Particle
Аргументы
particle_idint Particle ID registered in ParticleList to start playing
465 {
467 }

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

◆ SetWiggle()

override void SetWiggle ( float random_angle,
float random_interval )
inlineprotected

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
Аргументы
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
930 {
931 if (random_angle != 0 || random_interval != 0)
932 {
933 if (IsWiggling())
934 {
937 return;
938 }
939
940 // We need the position to be accurate before storing it
941 Update();
942
943 // These are only ever used within the Wiggle API
944 // To restore the properties after wiggling
945 // So let's only set them within the Wiggle API c:
946
948 m_DefaultOri = GetLocalYawPitchRoll();
949 m_DefaultWorldPos = GetWorldPosition();
950 m_DefaultWorldOri = GetYawPitchRoll();
951 m_ForceOrientationRelativeToWorld = IsHierarchyPositionOnly();
952 }
953
955 }
vector GetLocalPosition()
Get the local position of the Effect.
Definition Effect.c:488
proto native volatile void Update()
Definition PlayerSoundManager.c:125

Перекрестные ссылки GetLocalPosition(), Particle::IsWiggling(), Particle::m_DefaultOri, Particle::m_DefaultPos, Particle::m_DefaultWorldOri, Particle::m_DefaultWorldPos, Particle::m_ForceOrientationRelativeToWorld, Particle::m_MaxOriInterval, Particle::m_MaxOriWiggle и Update().

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

◆ StopParticle()

override bool StopParticle ( int flags = 0)
inlineprivate

Method to tell the particle to stop playing.

Аргументы
flagsint Flags to pass to the stopping (StopParticleFlags)
Возвращает
bool Whether the particle successfully stopped
373 {
374 return StopParticleNative(flags);
375 }
proto bool StopParticleNative(int flags)
Method to tell the particle to stop playing.

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

Используется в FireworksLauncher::OnFiringStartClient(), GeyserTrigger::StopEffects(), GeyserTrigger::UpdateGeyserState() и FireworksLauncherClientEvent::~FireworksLauncherClientEvent().

◆ StopParticleNative()

proto bool StopParticleNative ( int flags)
private

Method to tell the particle to stop playing.

Заметки
The particle is not immediately stopped by default, instead it will gradually fade If this is however desired, then pass in StopParticleFlags.IMMEDIATE
Аргументы
flagsint Flags to pass to the stopping (StopParticleFlags)
Возвращает
bool Whether the particle successfully stopped

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

◆ StopWiggle()

override void StopWiggle ( )
inlineprotected

Stops randomized wiggle.

961 {
962 bool wiggling = IsWiggling();
963
964 super.StopWiggle();
965
966 if (wiggling)
967 {
968 // Restore pre-wiggle orientation
969 int flags = ParticlePropertiesFlags.NONE;
970
972 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
973
974 ParticleProperties prop = new ParticleProperties(m_DefaultPos, flags, GetParticleParent(), m_DefaultOri, GetOwner());
976 }
977 }

Перекрестные ссылки ApplyProperties(), GetOwner(), GetParticleParent(), Particle::IsWiggling(), Particle::m_DefaultOri, Particle::m_DefaultPos и Particle::m_ForceOrientationRelativeToWorld.

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

◆ UpdateState()

void UpdateState ( )
inlineprivate

Empty.

1013{ ErrorEx("Should not be in use on ParticleSource."); }

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


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