PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

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