public SharedEmitterManager(ParticleSystemManager manager)
            : base(manager)
        {
            Persistent = true;  // Tell ParticleSystemManager not to clear me.

            //
            // Create shared emitters.
            //

            // Smoke
            smoke    = new SharedSmokeEmitter[kNumSmokes];
            smoke[0] = new SharedSmokeEmitter(manager, 5000);
            smoke[1] = new SharedSmokeEmitter(manager, 8000);
            smoke[2] = new SharedSmokeEmitter(manager, 2000);
            smoke[3] = new SharedSmokeEmitter(manager, 2000);

            distortedSmoke       = new SharedSmokeEmitter(manager, 1000);
            distortedSmoke.Usage = Use.Distort;

            beam = new BeamManager(manager);

            bleep = new BleepManager(manager);

            spark = new SharedSparkEmitter(manager, 1000);

            splash = new SharedSplashEmitter(manager, 1000);
        }   // end of c'tor
 // c'tor
 public WaterParticleEmitter(ParticleSystemManager manager)
     : base(manager)
 {
     Persistent = true;      // Tell manager not to clear me.
     Usage      = Use.Never; // Don't auto draw me, wait for explicit render.
     BokuGame.Load(this);
 }                           // end of c'tor
Exemplo n.º 3
0
 public PlasmaEmitter(ParticleSystemManager manager)
     : base(manager)
 {
     ExplicitBloom = 0.9f;
     StartAlpha    = 0f;
     EndAlpha      = 0f;
 }
Exemplo n.º 4
0
 public StarEmitter(ParticleSystemManager manager)
     : base(manager)
 {
     WreathRadius = 0.5f;
     WreathRate   = -1.0f;
     NumTiles     = 2;
 }   // end of c'tor
Exemplo n.º 5
0
        // c'tor
        public InkEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            Color       = new Vector4(0.13f, 0.1f, 0.2f, 1.0f);
            StartRadius = 0.7f;
            EndRadius   = 1.4f;

            StartAlpha = 1.0f;
            EndAlpha   = 0.0f;

            MinLifetime = 0.2f;     // Particle lifetime.
            MaxLifetime = 1.0f;

            EmissionRate = 50.0f;  // Particles per second.

            MaxSpeed = 100.0f;

            PositionJitter = 0.5f;  // Random offset for each particle.
            Gravity        = new Vector3(0.0f, 0.0f, 0.0f);
            // Color = new Vector4(1.0f, 1.0f, 1.0f, 0.5f);
            MaxRotationRate = 0.2f;

            /*
             * Color = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
             * StartRadius = 0.0f;
             * EndRadius = 1.0f;
             * StartAlpha = 1.0f;
             * EndAlpha = 0.0f;
             * MinLifetime = 0.2f;     // Particle lifetime.
             * MaxLifetime = 1.0f;
             * EmissionRate = 100.0f;  // Particles per second.
             *
             * MaxRotationRate = 2.0f;
             */
        }   // end of c'tor
Exemplo n.º 6
0
 public SwearEmitter(ParticleSystemManager manager)
     : base(manager)
 {
     WreathRadius    = 0.75f;
     WreathRate      = 0.5f;
     NumTiles        = 8;
     MaxRotationRate = 0.0f;
 }   // end of c'tor
Exemplo n.º 7
0
        // c'tor
        public GlowEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            const int numInitParticles = 5;

            for (int i = 0; i < numInitParticles; ++i)
            {
                unused.Add(new GlowParticle());
            }
        }                             // end of c'tor
            // c'tor
            public FireballParticle(Color color, ParticleSystemManager manager)
            {
                this.age   = 0.0f;
                this.color = color;

                smokeEmitter        = new SmokeEmitter(manager);
                smokeEmitter.Active = true;

                fireball = new Fireball(Classification.Colors.Red);
                InGame.inGame.gameThingList.Add(fireball);
                fireball.Activate();
            } // end of c'tor
Exemplo n.º 9
0
        // c'tor
        public BaseEmitter(ParticleSystemManager manager)
        {
            this.manager = manager;
            particleList = new List <object>();

            // Don't add self to manager's list by default.  This will be handled
            // by owning object's Refresh call.
            //manager.AddEmitter(this);

            // Force the prevPosition to be "reset" on first call.
            prevPosition.X = float.MaxValue;
        }   // end of c'tor
Exemplo n.º 10
0
        // c'tor
        public ExplosionEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            Color        = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
            StartRadius  = 0.0f;
            EndRadius    = 1.0f;
            StartAlpha   = 1.0f;
            EndAlpha     = 0.0f;
            MinLifetime  = 0.2f;    // Particle lifetime.
            MaxLifetime  = 1.0f;
            EmissionRate = 100.0f;  // Particles per second.

            MaxRotationRate = 2.0f;
        }   // end of c'tor
Exemplo n.º 11
0
        // c'tor
        public SmokeEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            Color        = new Vector4(0.5f, 0.5f, 0.5f, 1.0f);
            StartRadius  = 0.2f;
            EndRadius    = 3.0f;
            StartAlpha   = 1.0f;
            EndAlpha     = 0.0f;
            MinLifetime  = 1.5f;    // Particle lifetime.
            MaxLifetime  = 4.0f;
            EmissionRate = 50.0f;   // Particles per second.

            ExplicitBloom = 0.004f; // ~1.0f / 255.0f;

            MaxRotationRate = 2.0f;
        }   // end of c'tor
Exemplo n.º 12
0
        public SharedSmokeEmitter(ParticleSystemManager manager, int maxParticles)
            : base(manager)
        {
            this.maxParticles     = Math.Min(kMaxParticles, maxParticles);
            particleDeathTimeList = new float[this.maxParticles];

            localVertices = new SmokeVertex[this.maxParticles * 4];     // 4 vertices per particle.

            for (int p = 0; p < this.maxParticles; p++)
            {
                // Init the UV coords which never change.
                localVertices[p * 4 + 0].uv = new Vector2(0.0f, 0.0f);
                localVertices[p * 4 + 1].uv = new Vector2(1.0f, 0.0f);
                localVertices[p * 4 + 2].uv = new Vector2(1.0f, 1.0f);
                localVertices[p * 4 + 3].uv = new Vector2(0.0f, 1.0f);
            }
        }   // end of c'tor
Exemplo n.º 13
0
        // c'tor
        public SteamEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            EmissionRate = 20.0f;
            Color        = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
            StartRadius  = 0.5f;
            EndRadius    = 0.1f;
            StartAlpha   = 0.6f;
            EndAlpha     = 0.0f;
            MinLifetime  = 1.0f;      // Particle lifetime.
            MaxLifetime  = 4.0f;

            MaxRotationRate = 2.0f;

            Gravity       = new Vector3(0.0f, 0.0f, 1.0f);
            this.MaxSpeed = 1.5f;
        }   // end of c'tor
Exemplo n.º 14
0
        // c'tor
        public HeartEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            EmissionRate   = 20.0f;
            Color          = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
            StartRadius    = 0.1f;
            EndRadius      = 0.5f;
            PositionJitter = 0.5f;
            StartAlpha     = 1.0f;
            EndAlpha       = 0.0f;
            MinLifetime    = 3.0f;      // Particle lifetime.
            MaxLifetime    = 6.0f;

            MaxRotationRate = 0.0f;

            // Have hearts float up a bit.
            Gravity  = new Vector3(0.0f, 0.0f, 0.2f);
            MaxSpeed = 10.0f;
        }   // end of c'tor
Exemplo n.º 15
0
        // c'tor
        public WreathEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            EmissionRate   = 10.0f;
            Color          = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
            StartRadius    = 0.1f;
            EndRadius      = 0.2f;
            PositionJitter = 0.1f;
            StartAlpha     = 1.0f;
            EndAlpha       = 0.0f;
            MinLifetime    = 2.5f;    // Particle lifetime.
            MaxLifetime    = 5.0f;

            MaxRotationRate = 2.0f;

            NumTiles = 4;

            // Have wreaths float up a bit.
            Gravity  = new Vector3(0.0f, 0.0f, 0.05f);
            MaxSpeed = 10.0f;
        }   // end of c'tor
        public BaseSharedEmitter(ParticleSystemManager manager)
        {
            this.manager = manager;

            // Init localIndices if needed.
            if (localIndices == null)
            {
                localIndices = new short[kMaxParticles * 6];    // 1 particle == 2 triangles == 6 indices.

                int v = 0;
                int i = 0;
                for (int p = 0; p < kMaxParticles; p++)
                {
                    localIndices[i++] = (short)(v + 0);
                    localIndices[i++] = (short)(v + 1);
                    localIndices[i++] = (short)(v + 2);
                    localIndices[i++] = (short)(v + 0);
                    localIndices[i++] = (short)(v + 2);
                    localIndices[i++] = (short)(v + 3);
                    v += 4;
                }
            }
        }   // end of c'tor
Exemplo n.º 17
0
        // c'tor
        public FanEmitter(ParticleSystemManager manager)
            : base(manager)
        {
            StartRadius = 0.1f;
            EndRadius   = 0.1f;

            StartAlpha = 1.0f;
            EndAlpha   = 1.0f;

            MinLifetime = 0.5f;     // Particle lifetime.
            MaxLifetime = 2.0f;

            EmissionRate = 4.0f;  // Particles per second.

            MaxSpeed = 5.0f;

            PositionJitter  = 0.7f; // Random offset for each particle.
            Gravity         = new Vector3(0.0f, 0.0f, 0.0f);
            Color           = new Vector4(1.0f, 1.01f, 1.0f, 0.8f);
            MaxRotationRate = 0.0f;

            NumTiles = 2;
        }   // end of c'tor
Exemplo n.º 18
0
 // c'tor
 public SmokeEmitter3D(ParticleSystemManager manager)
     : base(manager)
 {
 }                             // end of c'tor
Exemplo n.º 19
0
 /// <summary>
 /// Make us.
 /// </summary>
 /// <param name="manager"></param>
 public BleepManager(ParticleSystemManager manager)
     : base(manager)
 {
     maxParticles = kMaxBleeps;
 }
Exemplo n.º 20
0
        private Vector3 gravity = new Vector3(0.0f, 0.0f, -3.0f); // Damped version of gravity.

        #region Accessors
        #endregion

        // c'tor
        public SparkEmitter(ParticleSystemManager manager)
            : base(manager)
        {
        }   // end of c'tor
Exemplo n.º 21
0
 /// <summary>
 /// Make us.
 /// </summary>
 /// <param name="manager"></param>
 public BeamManager(ParticleSystemManager manager)
     : base(manager)
 {
     maxParticles = kMaxBeams;
 }
Exemplo n.º 22
0
 // c'tor
 public FireballEmitter(ParticleSystemManager manager)
     : base(manager)
 {
 }   // end of c'tor
 public SharedSmokeSource(ParticleSystemManager manager)
     : base(manager)
 {
 }   // end of c'tor
Exemplo n.º 24
0
 public SharedSplashEmitter(ParticleSystemManager manager, int maxParticles)
     : base(manager, maxParticles)
 {
 }
Exemplo n.º 25
0
 // c'tor
 public BaseSpriteEmitter(ParticleSystemManager manager)
     : base(manager)
 {
 }   // end of c'tor