예제 #1
0
        public override void Initialize(Texture2D TextureForParticle, int ParticleCount, int MaxLife, Direction Direction, BoundingBox EnviromentBounds, Color Color)
        {
            base._t2dMainTexture = TextureForParticle;
            base._pContainer = new Particle[ParticleCount];
            base.EnviromentBounds = EnviromentBounds;
            base._Points = new VertexPositionColor[ParticleCount];
            for (int i = 0; i < ParticleCount; i++)
            {
                _pContainer[i] = new Particle();
                _pContainer[i].Life = Engine.Randomize(MaxLife / 4, MaxLife);
                _Points[i].Color = Color;
                _Points[i].Position = Engine.TempVector3(Engine.Randomize((int)EnviromentBounds.Min.X, (int)EnviromentBounds.Max.X),
                    Engine.Randomize((int)EnviromentBounds.Min.Y, (int)EnviromentBounds.Max.Y + 100),
                    Engine.Randomize((int)EnviromentBounds.Min.Z, (int)EnviromentBounds.Max.Z));
                float a = Engine.Randomize(2, 6);
                _pContainer[i].Velocity.Y = (a / DIVISIONAL_COEFFICENT);
                if(Engine.Randomize(1, 3) == 1)
                _pContainer[i].Velocity.X = (a / DIVISIONAL_COEFFICENT);
                else _pContainer[i].Velocity.X = -(a / DIVISIONAL_COEFFICENT);

                if(Engine.Randomize(1, 3) == 2)
                    _pContainer[i].Velocity.Z = (a / DIVISIONAL_COEFFICENT);
                else _pContainer[i].Velocity.Z = -(a / DIVISIONAL_COEFFICENT);
            }
        }
예제 #2
0
 public override void Initialize(Texture2D TextureForParticle, int ParticleCount, int MaxLife, Direction Direction, BoundingBox EnviromentBounds)
 {
     base._t2dMainTexture = TextureForParticle;
     base._pContainer = new Particle[ParticleCount];
     base.EnviromentBounds = EnviromentBounds;
     base._Points = new VertexPositionColor[ParticleCount];
     for (int i = 0; i < ParticleCount; i++)
     {
         _pContainer[i] = new Particle();
         _pContainer[i].Life = Engine.Randomize(MaxLife / 4, MaxLife);
         _Points[i].Color = Color.White;
         _Points[i].Position = Engine.TempVector3(Engine.Randomize((int)EnviromentBounds.Min.X, (int)EnviromentBounds.Max.X),
             Engine.Randomize((int)EnviromentBounds.Min.Y, (int)EnviromentBounds.Max.Y + 100),
             Engine.Randomize((int)EnviromentBounds.Min.Z, (int)EnviromentBounds.Max.Z));
         _pContainer[i].Velocity.Y = Engine.Randomize(1, 3) / 3;
     }
 }