PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/Microsoft.Research.Visualization3D/Providers/Particles/ExplosionParticleSystem.cs

#
C# | 50 lines | 36 code | 13 blank | 1 comment | 0 complexity | 4154efa6406fe7850801dabfb70204a8 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using SlimDX.Direct3D9;
 6using Microsoft.Research.Visualization3D.CameraUtilities;
 7
 8namespace Microsoft.Research.Visualization3D.Particles
 9{
10    class ExplosionParticleSystem : ParticleSystem
11    {
12        public ExplosionParticleSystem(DX3DHost host, Visualization3DDataSource dataSource) : 
13            base(host, dataSource)
14        {
15
16        }
17        
18        protected override void InitializeSettings(ParticleSettings settings)
19        {
20            settings.TextureName = "smoke.png";
21
22            settings.MaxParticles = 1000;
23
24            settings.Duration = TimeSpan.FromSeconds(2.5);
25            settings.DurationRandomness = 1;
26
27            settings.MinHorizontalVelocity = 20;
28            settings.MaxHorizontalVelocity = 30;
29
30            settings.MinVerticalVelocity = -20;
31            settings.MaxVerticalVelocity = 20;
32
33            settings.EndVelocity = 0;
34
35            settings.MinRotateSpeed = -1;
36            settings.MaxRotateSpeed = 1;
37
38            settings.MinStartSize = 1;
39            settings.MaxStartSize = 1;
40
41            settings.MinEndSize = 10;
42            settings.MaxEndSize = 10;
43
44            // Use additive blending.
45            settings.SourceBlend = Blend.SourceAlpha;
46            settings.DestinationBlend = Blend.One;
47
48        }
49    }
50}