CapgeminiSurface.ParticleSystemManagerEntity.CreateParticleSystem C# (CSharp) Method

CreateParticleSystem() public method

public CreateParticleSystem ( int maxCount, Color color ) : System.Windows.Media.Media3D.Model3D
maxCount int
color Color
return System.Windows.Media.Media3D.Model3D
        public Model3D CreateParticleSystem(int maxCount, Color color)
        {
            var particleSystem = new ParticleSystem(maxCount, color);
            _particleSystems.Add(color, particleSystem);
            return particleSystem.ParticleModel;
        }

Usage Example

        public ParticleSystemManager()
        {
            InitializeComponent();

            sAmount.Value = _maxParticlesPerColor;

            GenerateParticles = true;

            SetParticleDuration(10.0);
            SetSpeedSlider(15.0);

            _frameTimer = new DispatcherTimer();
            _frameTimer.Tick += OnFrame;
            _frameTimer.Interval = TimeSpan.FromSeconds(1.0/RendersPerSecond);
            _frameTimer.Start();

            _spawnPoint = new Point3D(0, 0, 0.0);
            _lastTick = Environment.TickCount;

            _particleSystemManagerEntity = new ParticleSystemManagerEntity();

            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.Silver));
            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.LightBlue));
            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.DarkRed));
            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.LightSeaGreen));
            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.Yellow));
            WorldModels.Children.Add(_particleSystemManagerEntity.CreateParticleSystem(_maxParticlesPerColor,
                                                                                      Colors.Pink));
            _random = new Random(GetHashCode());
        }