Beispiel #1
0
        public override void InicializarParticulas()
        {
            Random        r = new Random(this.Seed);
            int           i, posTex = 0, posCol = 0;
            Vector3       randomVect;
            ExplosionPart p;

            //Creo una primera particula sin direccion asi queda en el centro
            posCol = r.Next(0, this.Colours.Count);
            p      = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, new Vector3(0, 0, 0), this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
            this.Particles.Add(p);
            this.ParticlesVertex.Add(p.CV_PositionColored);

            //Se crean las particulas restantes
            for (i = 0; i < (this.ParticlesAmount - 1); i++)
            {
                randomVect = this.RandVec3();
                posTex     = r.Next(0, this.Textures.Count);
                posCol     = r.Next(0, this.Colours.Count);
                p          = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, randomVect, this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
                this.Particles.Add(p);
                //Se le pone i+1 por la particula que ya se creo antes del ciclo
                p.Index_ParticleVertex = (i + 1);
                this.ParticlesVertex.Add(p.CV_PositionColored);
            }
        }
Beispiel #2
0
        public override void AgregarParticulas(int cantidad)
        {
            Vector3       randomVect;
            ExplosionPart p;
            int           i, posTex = 0, posCol = 0;

            for (i = this.ParticlesAmount; i < (this.ParticlesAmount + cantidad); i++)
            {
                randomVect = this.RandVec3();
                posTex     = r.Next(0, this.Textures.Count);
                posCol     = r.Next(0, this.Colours.Count);
                p          = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, randomVect, this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
                this.Particles.Add(p);
                //Se le pone i+1 por la particula que ya se creo antes del ciclo
                p.Index_ParticleVertex = (i + 1);
                this.ParticlesVertex.Add(p.CV_PositionColored);
            }
            this.ParticlesAmount += cantidad;
        }
        public override void InicializarParticulas()
        {
            Random r = new Random(this.Seed);
            int i, posTex = 0, posCol = 0;
            Vector3 randomVect;
            ExplosionPart p;

            //Creo una primera particula sin direccion asi queda en el centro
            posCol = r.Next(0, this.Colours.Count);
            p = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, new Vector3(0, 0, 0), this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
            this.Particles.Add(p);
            this.ParticlesVertex.Add(p.CV_PositionColored);

            //Se crean las particulas restantes
            for (i = 0; i < (this.ParticlesAmount-1); i++)
            {
                randomVect = this.RandVec3();
                posTex = r.Next(0, this.Textures.Count);
                posCol = r.Next(0, this.Colours.Count);
                p = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, randomVect, this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
                this.Particles.Add(p);
                //Se le pone i+1 por la particula que ya se creo antes del ciclo
                p.Index_ParticleVertex = (i+1);
                this.ParticlesVertex.Add(p.CV_PositionColored);
            }
        }
 public override void AgregarParticulas(int cantidad)
 {
     Vector3 randomVect;
     ExplosionPart p;
     int i, posTex = 0, posCol = 0;
     for (i = this.ParticlesAmount; i < (this.ParticlesAmount + cantidad); i++)
     {
         randomVect = this.RandVec3();
         posTex = r.Next(0, this.Textures.Count);
         posCol = r.Next(0, this.Colours.Count);
         p = new ExplosionPart(this.InitCoords, this.Speed, this.Acceleration, randomVect, this.Colours[posCol], this.InitialAlpha, this.PointSizeMin, this.TimeToLive_Particle, this.Textures[0], this.SizeSpeed);
         this.Particles.Add(p);
         //Se le pone i+1 por la particula que ya se creo antes del ciclo
         p.Index_ParticleVertex = (i + 1);
         this.ParticlesVertex.Add(p.CV_PositionColored);
     }
     this.ParticlesAmount += cantidad;
 }