public void Init(OpenGL gl) { _beatDetector.BeatDetected = (() => { // Pick a color int color = _random.Next(Constants.Colors.Length / 3); // Init new particle system ParticleSystem particleSystem = new ParticleSystem(); particleSystem.AfterParticleInit = ((particle, speedModifier) => { particle.FixedVelocityModifier = 5.0f; particle.DieRate = ((_random.Next(10)) + 99.0f) / 12000.0f; particle.Xi *= particle.FixedVelocityModifier; particle.Yi *= particle.FixedVelocityModifier; particle.Zi *= particle.FixedVelocityModifier; particle.R = Constants.Colors[color, 0]; particle.G = Constants.Colors[color, 1]; particle.B = Constants.Colors[color, 2]; }); particleSystem.Init(gl, OpenGL.GL_SRC_ALPHA, ParticleCount, false, false); float originX = _random.Next(20) - 10; float originY = _random.Next(20) - 10; float originZ = _random.Next(20) - 30; _activeParticleSystems.Add(new Tuple <ParticleSystem, float, float, float>(particleSystem, originX, originY, originZ)); }); _beatDetector.Start(); }
public void Init(OpenGL gl) { _beatDetector.Start(); }