DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ParticleManager.c
См. документацию.
14
17{
22#ifdef BULDOZER
23 static const int POOL_SIZE = 1;
24#else
25 static const int POOL_SIZE = 10000;
26#endif
27 static const int FLAGS = ParticleManagerSettingsFlags.NONE;
29}
30
33{
39 void ParticleManagerSettings(int poolSize, int flags = ParticleManagerSettingsFlags.NONE)
40 {
41 }
42
45 {
46 }
48
55
58{
61
64 {
65 if (!g_ParticleManager && !GetGame().IsDedicatedServer())
66 {
71 g_ParticleManager.SetName("GlobalParticleManager");
72 }
73
74 return g_ParticleManager;
75 }
76
78 static void CleanupInstance()
79 {
81 delete g_ParticleManager;
82 }
83
89 {
90 }
91
94 {
95 }
96
97
98
103
115 ParticleSource CreateParticle( int id, vector pos, bool playOnCreation = false, Object parent = null, vector ori = vector.Zero, bool forceWorldRotation = false, Class owner = null )
116 {
117 int flags = ParticlePropertiesFlags.NONE;
118
119 if (playOnCreation)
120 {
121 flags = flags | ParticlePropertiesFlags.PLAY_ON_CREATION;
122 }
123
124 if (forceWorldRotation)
125 {
126 flags = flags | ParticlePropertiesFlags.FORCE_WORLD_ROT;
127 }
128
129 return CreateParticleEx(id, pos, flags, parent, ori, owner);
130 }
131
142 ParticleSource CreateParticleEx( int id, vector pos, int flags = ParticlePropertiesFlags.NONE, Object parent = null, vector ori = vector.Zero, Class owner = null )
143 {
144 string particlePath = ParticleList.GetParticleFullPath(id);
145 if (particlePath == "") // There is already an error inside of ParticleList signaling this
146 {
147 ErrorEx(string.Format("Could not create ParticleSource as particle id %1 is invalid.", id));
148 return null;
149 }
150
151 ParticleProperties props = new ParticleProperties(pos, flags, parent, ori, owner);
152 ParticleSource p = CreateParticleByPath(particlePath, props);
153 return p;
154 }
155
166 int particle_id,
167 Object parent_obj,
168 vector local_pos = "0 0 0",
169 vector local_ori = "0 0 0",
170 bool force_world_rotation = false )
171 {
172 return CreateParticle(particle_id, local_pos, false, parent_obj, local_ori, force_world_rotation);
173 }
174
178 ParticleSource Create( int particle_id, Object parent_obj, vector local_pos = "0 0 0", vector local_ori = "0 0 0" )
179 {
180 return CreateOnObject( particle_id, parent_obj, local_pos, local_ori);
181 }
182
191 ParticleSource CreateInWorld( int particle_id, vector global_pos, vector global_ori = "0 0 0", bool force_world_rotation = false )
192 {
193 return CreateParticle(particle_id, global_pos, false, null, global_ori, force_world_rotation);
194 }
195
199 ParticleSource Create( int particle_id, vector global_pos, vector global_ori = "0 0 0" )
200 {
201 return CreateInWorld( particle_id, global_pos, global_ori );
202 }
203
205
206
207
212
222 ParticleSource PlayOnObject(int particle_id, Object parent_obj, vector local_pos = "0 0 0", vector local_ori = "0 0 0", bool force_world_rotation = false )
223 {
224 return CreateParticle(particle_id, local_pos, true, parent_obj, local_ori, force_world_rotation);
225 }
226
230 ParticleSource Play( int particle_id, Object parent_obj, vector local_pos = "0 0 0", vector local_ori = "0 0 0" )
231 {
232 return PlayOnObject( particle_id, parent_obj, local_pos, local_ori);
233 }
234
242 {
243 return PlayInWorldEx(particle_id, null, global_pos);
244 }
245
246 ParticleSource PlayInWorldEx(int particle_id, Object parent_obj, vector global_pos, vector global_ori = "0 0 0", bool force_world_rotation = false)
247 {
248 return CreateParticle(particle_id, global_pos, true, parent_obj, global_ori, force_world_rotation);
249
250 }
251
256 {
257 return PlayInWorld( particle_id, global_pos);
258 }
259
261
262
263
268
277 proto native int CreateParticles(array<ParticleSource> particles, string path, notnull ParticlePropertiesArray properties, int count = 1);
278
285 ParticleSource CreateParticleByPath(string path, notnull ParticleProperties properties)
286 {
288 CreateParticles(tempArr, path, {properties}, 1);
289
290 if (tempArr.Count() > 0)
291 return tempArr[0];
292 else
293 return null;
294 }
295
303 int CreateParticlesById(int id, notnull ParticlePropertiesArray properties, int count)
304 {
305 return CreateParticles(null, ParticleList.GetParticleFullPath(id), properties, count);
306 }
307
315 array<ParticleSource> CreateParticlesByIdArr(int id, notnull ParticlePropertiesArray properties, int count)
316 {
318 CreateParticles(outArr, ParticleList.GetParticleFullPath(id), properties, count);
319 return outArr;
320 }
321
328 ParticleSource CreateParticleById(int id, ParticleProperties properties)
329 {
331 CreateParticles(tempArr, ParticleList.GetParticleFullPath(id), {properties}, 1);
332
333 if (tempArr.Count() > 0)
334 return tempArr[0];
335 else
336 return null;
337 }
338
347 proto native int PlayParticles(out array<ParticleSource> particles, string path, notnull array<vector> positions, int count = 1);
348
357 {
359 PlayParticles(outArr, ParticleList.GetParticleFullPath(id), positions, count);
360 return outArr;
361 }
362
370 {
372 PlayParticles(tempArr, ParticleList.GetParticleFullPath(id), position, 1);
373
374 if (tempArr.Count() > 0)
375 return tempArr[0];
376 else
377 return null;
378 }
379
385 proto native ParticleSource GetParticle(int index);
386
394 proto native int GetParticles(out array<ParticleSource> outArray, int startIndex, int count);
395
402 array<ParticleSource> GetParticlesEx(int startIndex, int count)
403 {
405 GetParticles(outArr, startIndex, count);
406 return outArr;
407 }
408
410
411
412
417
422 proto native void SetName(string name);
423
428 proto string GetName();
429
434 proto string GetDebugNameNative();
435
440 override string GetDebugName()
441 {
442 return GetDebugNameNative();
443 }
444
449 proto int GetCountID();
450
455 proto native static int GetStaticCount();
456
461 proto native static int GetStaticActiveCount();
462
464
465
466
471
476 proto native int GetPoolSize();
477
482 proto native int GetAllocatedCount();
483
488 proto native int GetVirtualCount();
489
494 proto native int GetPlayingCount();
495
500 proto native bool IsFinishedAllocating();
501
503
504
505
510
515 private proto void SetScriptEvents(Managed events);
516
521 private proto Managed GetScriptEvents();
522
531
533
534
535
540
541 void OnAllocation(array<ParticleSource> allocatedParticles)
542 {
543 GetEvents().Event_OnAllocation.Invoke(this, allocatedParticles);
544 }
545
547 {
548 GetEvents().Event_OnAllocationEnd.Invoke(this);
549 }
550
552}
void CreateParticle()
Определения BleedingSource.c:83
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
static AnimSoundObjectBuilderBank GetInstance()
Определения DayZAnimEventMaps.c:186
string path
Определения OptionSelectorMultistate.c:142
ParticleEvents GetEvents()
Get the events.
Определения ParticleBase.c:162
proto native int PlayParticles(out array< ParticleSource > particles, string path, notnull array< vector > positions, int count=1)
QoL function for when wanting to play a particle at a position right away.
proto native int GetVirtualCount()
Gets the amount of virtual particles.
proto native int GetPoolSize()
Gets the fixed maximum size of the pool.
class ParticleManagerConstants ParticleManagerSettings(int poolSize, int flags=ParticleManagerSettingsFlags.NONE)
Settings given to ParticleManager on creation (in ctor)
Определения ParticleManager.c:39
ParticleSource PlayInWorldEx(int particle_id, Object parent_obj, vector global_pos, vector global_ori="0 0 0", bool force_world_rotation=false)
Определения ParticleManager.c:246
proto native int GetPlayingCount()
Gets the amount of playing particles.
ParticleSource PlayParticleById(int id, array< vector > position)
QoL function for when only one particle is needed using script ParticleList, strongly recommend to re...
Определения ParticleManager.c:369
proto static native int GetStaticActiveCount()
Gets the amount of ParticleManager that are currently existing.
proto native int GetParticles(out array< ParticleSource > outArray, int startIndex, int count)
Manually get a portion of the particles in the pool.
ParticleSource CreateParticleEx(int id, vector pos, int flags=ParticlePropertiesFlags.NONE, Object parent=null, vector ori=vector.Zero, Class owner=null)
Master create function.
Определения ParticleManager.c:142
proto int GetCountID()
Gets the ID for the ParticleManager.
static void CleanupInstance()
To clean it up properly before game closes.
Определения ParticleManager.c:78
ParticleSource 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.
Определения ParticleManager.c:191
ParticleSource 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.
Определения ParticleManager.c:165
void OnAllocation(array< ParticleSource > allocatedParticles)
Определения ParticleManager.c:541
array< ParticleSource > CreateParticlesByIdArr(int id, notnull ParticlePropertiesArray properties, int count)
QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as we...
Определения ParticleManager.c:315
proto string GetDebugNameNative()
Gets the debug name for the ParticleManager.
void OnAllocationEnd()
Определения ParticleManager.c:546
ParticleSource PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
Определения ParticleManager.c:241
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.
void ~ParticleManager()
dtor
Определения ParticleManager.c:93
int CreateParticlesById(int id, notnull ParticlePropertiesArray properties, int count)
QoL function using script ParticleList, strongly recommend to read comments for CreateParticles as we...
Определения ParticleManager.c:303
proto native int GetAllocatedCount()
Gets the amount of particles currently allocated.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
ParticleSource CreateParticleById(int id, ParticleProperties properties)
QoL function for when only one particle is needed using script ParticleList, strongly recommend to re...
Определения ParticleManager.c:328
ParticleSource 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.
Определения ParticleManager.c:222
ParticleManagerSettingsFlags
Flags for ParticleManagerSettings.
Определения ParticleManager.c:3
@ REUSE_OWNED
Reuse stopped particles even if they are owned by something.
Определения ParticleManager.c:12
@ DISABLE_VIRTUAL
Disable the creation of virtual particles when the pool is still allocating.
Определения ParticleManager.c:10
@ BLOCKING
Allocation blocks the game until it is done.
Определения ParticleManager.c:8
@ FIXED_INDEX
Particles will be locked to the index and not reused.
Определения ParticleManager.c:6
proto native bool IsFinishedAllocating()
Checks if the ParticleManager has allocated all slots in the pool.
array< ParticleSource > PlayParticlesById(int id, array< vector > positions, int count)
QoL function using script ParticleList, strongly recommend to read comments for PlayParticles as well...
Определения ParticleManager.c:356
array< ParticleSource > GetParticlesEx(int startIndex, int count)
Manually get a portion of the particles in the pool.
Определения ParticleManager.c:402
ParticleSource CreateParticleByPath(string path, notnull ParticleProperties properties)
Create a particle.
Определения ParticleManager.c:285
proto static native int GetStaticCount()
Gets the amount of ParticleManager that have been created since the start of the program.
class ParticleManagerEvents g_ParticleManager
Has a fixed pool of precreated and reserved particles.
proto Managed GetScriptEvents()
Get the events.
proto native int CreateParticles(array< ParticleSource > particles, string path, notnull ParticlePropertiesArray properties, int count=1)
Creates an amount of particles with the properties given.
proto void SetScriptEvents(Managed events)
Set the events.
void ~ParticleManagerSettings()
dtor
Определения ParticleManager.c:44
int particle_id
Определения SmokeSimulation.c:28
Super root of all classes in Enforce script.
Определения EnScript.c:11
TODO doc.
Определения EnScript.c:118
Определения ObjectTyped.c:2
static string GetParticleFullPath(int particle_id)
Returns particle's full path (with .ptc suffix) based on its ID.
Определения ParticleList.c:485
Определения ParticleList.c:12
static const int POOL_SIZE
Определения ParticleManager.c:25
static const int FLAGS
Определения ParticleManager.c:27
Class simply to have easily modded constants.
Определения ParticleManager.c:17
ref ScriptInvoker Event_OnAllocation
Определения ParticleManager.c:52
ref ScriptInvoker Event_OnAllocationEnd
Определения ParticleManager.c:53
Invokers for ParticleManager events.
Определения ParticleManager.c:51
Entity which has the particle instance as an ObjectComponent.
Определения ParticleSource.c:124
ScriptInvoker Class provide list of callbacks usage:
Определения tools.c:116
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static const vector Zero
Определения EnConvert.c:110
Определения EnConvert.c:106
override string GetDebugName()
Определения dayzplayer.c:1170
proto native CGame GetGame()
static proto native Shape Create(ShapeType type, int color, ShapeFlags flags, vector p1, vector p2)
enum ShapeType ErrorEx
@ NONE
No flags.
Определения EnProfiler.c:11
proto void Play()
Определения SmptAnimMeta.c:144
proto native void SetName(string name)
proto native owned string GetName()
Test name getter. Strictly for UI porposes!
Определения SyncedValue.c:119