Beispiel #1
0
 public static void InitializeUniverse()
 {
     for (int i = 0; i < universeSeed.particleCount; i++)
     {
         var particle = new Gerticle();
         particle.Position.X = (float)particle.GetUPos().X;
         particle.Position.Y = (float)particle.GetUPos().Y;
         particle.Position.Z = (float)particle.GetUPos().Z;
         particle.CalculateNormals();
         Universe.Particles.Add(new Gerticle());
     }
 }
Beispiel #2
0
        void AddParticle()
        {
            lock (Particles)
            {
                var particle = new Gerticle();
                particle.Position.X = (float)particle.GetUPos().X;
                particle.Position.Y = (float)particle.GetUPos().Y;
                particle.Position.Z = (float)particle.GetUPos().Z;

                particle.CalculateNormals();

                Particles.Add(particle);

                ParticleAdded?.Invoke(this, new ParticleAddedEvent(particle));
            }
        }