예제 #1
0
        /// <summary>
        /// Restarts the simulation, deleting all particles and starting from Time = 0
        /// </summary>
        public void RestartSimulation()
        {
            DirtyParticlePool = true;
            pool.SetCapacity(0);

            // Restart all spawners
            foreach (var spawner in Spawners)
            {
                spawner.RestartSimulation();
            }

            // Restart all updaters
            foreach (var updater in Updaters)
            {
                updater.RestartSimulation();
            }
        }
예제 #2
0
        /// <summary>
        /// Resets the simulation, deleting all particles and starting from Time = 0
        /// </summary>
        public void ResetSimulation()
        {
            // Reset the particle pool which allocates unmanaged memory
            DirtyParticlePool = true;
            pool.SetCapacity(0);

            // Reset the vertex builder which allocates graphics memory
            VertexBuilder.Reset();

            // Restart all spawners
            foreach (var spawner in Spawners)
            {
                spawner.ResetSimulation();
            }

            // Restart all updaters
            foreach (var updater in Updaters)
            {
                updater.ResetSimulation();
            }

            hasBeenInitialized = false;
        }