Class ParticleCollection
Namespace: ValveResourceFormat.Particles
Assembly: ValveResourceFormat.dll
Manages the initial and current state arrays for all live particles in a system.
public class ParticleCollectionInheritance
Constructors
ParticleCollection(Particle, int)
Initializes a new with the given constant particle template and capacity.
public ParticleCollection(Particle constants, int maxParticles)Parameters
constants Particle
maxParticles int
Fields
MAX_PARTICLES
The hard upper limit on the number of particles in a single collection.
public const int MAX_PARTICLES = 5000Field Value
Properties
Capacity
Gets the maximum number of particles this collection can hold.
public int Capacity { get; }Property Value
Constants
Gets the constant attribute template used when spawning new particles.
public Particle Constants { get; }Property Value
Count
Gets the current number of live particles.
public int Count { get; }Property Value
Current
Gets a span over the current (this-frame) particle states.
public Span<Particle> Current { get; }Property Value
CurrentFrameTime
Duration of the step being simulated right now; 0 until the first step begins.
public float CurrentFrameTime { get; }Property Value
Initial
Gets a span over the initial (spawn-time) particle states.
public Span<Particle> Initial { get; }Property Value
KilledLastPass
How many particles the last removed. Emitters that spawn from killed parent particles read it from their parent system.
public int KilledLastPass { get; }Property Value
PreviousFrameTime
Duration of the previous simulation step. scales the Verlet inertia term by the current-to-previous step ratio so momentum stays framerate-independent; 0 until the first step completes.
public float PreviousFrameTime { get; }Property Value
Methods
Add()
Adds a new particle slot and returns its index, or -1 if the collection is full.
public int Add()Returns
Clear()
Removes all particles from the collection without deallocating the backing arrays.
public void Clear()PruneExpired()
Removes all particles that have been marked as killed, compacting the live array.
public void PruneExpired()
