/// <summary> /// Processes active particles. /// </summary> /// <param name="deltaSeconds">Elapsed time in whole and fractional seconds.</param> /// <param name="particle">A pointer to the first element in an array of particles.</param> /// <param name="count">The number of particles which need to be processed.</param> protected internal override unsafe void Process(float deltaSeconds, Particle* particle, int count) { for (int i = 0; i < count; i++) { // TODO modifier logic... particle++; } }
/// <summary> /// Sets an active particle by index. /// </summary> /// <param name="index">The index number of the particle to set.</param> /// <param name="particle">The particle to set.</param> public void Set(int index, ref Particle particle) { this._pool[(this._active + index < this._budget ? this._active + index : (this._active + index) - this._budget)] = particle; }
/// <summary> /// Gets an active particle by index. /// </summary> /// <param name="index">The index number of the particle to get.</param> /// <param name="particle">The retrieved particle.</param> public void Get(int index, out Particle particle) { particle = this._pool[(this._active + index < this._budget ? this._active + index : (this._active + index) - this._budget)]; }