Ejemplo n.º 1
0
 void addparticles()
 {
     ParticleBody pb = new ParticleBody(new Vector3(0, 15, 0), Vector3.Zero, Vector3.Zero, 1.0f, 10, Color.Azure, GraphicsDevice);
     pb.Particle.Generators.Add(new AnchoredSpring(new Disque.Math.Vector3(0, 30, 0), 50f, 5));
     pworld.Particles.Add(pb.Particle);
     drawables.Add(pb);
 }
Ejemplo n.º 2
0
 void setupcube()
 {
     ParticleBody pb1 = new ParticleBody(new Vector3(5, 20, 5), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Green, GraphicsDevice, 0.1f);
     ParticleBody pb2 = new ParticleBody(new Vector3(6, 20, 5), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Red, GraphicsDevice, 0.1f);
     ParticleBody pb3 = new ParticleBody(new Vector3(5, 20, 4), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Green, GraphicsDevice, 0.1f);
     ParticleBody pb4 = new ParticleBody(new Vector3(6, 20, 4), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Red, GraphicsDevice, 0.1f);
     ParticleBody pb5 = new ParticleBody(new Vector3(5, 21, 5), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Green, GraphicsDevice, 0.1f);
     ParticleBody pb6 = new ParticleBody(new Vector3(6, 21, 5), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Red, GraphicsDevice, 0.1f);
     ParticleBody pb7 = new ParticleBody(new Vector3(5, 21, 4), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Green, GraphicsDevice, 0.1f);
     ParticleBody pb8 = new ParticleBody(new Vector3(6, 21, 4), Vector3.Zero, Vector3.Zero, 1.0f, 40, Color.Red, GraphicsDevice, 0.1f);
     setuprod(pb1, pb2, 1);
     setuprod(pb3, pb4, 1);
     setuprod(pb5, pb6, 1);
     setuprod(pb7, pb8, 1);
     setuprod(pb1, pb3, 1);
     setuprod(pb2, pb4, 1);
     setuprod(pb5, pb7, 1);
     setuprod(pb6, pb8, 1);
     setuprod(pb1, pb5, 1);
     setuprod(pb2, pb6, 1);
     setuprod(pb3, pb7, 1);
     setuprod(pb4, pb8, 1);
     addparticle(pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8);
 }
Ejemplo n.º 3
0
 void addparticle(Vector3 pos, Color color, float density)
 {
     ParticleBody pb = new ParticleBody(pos, Vector3.Zero, Vector3.Zero, 1.0f, density, color, GraphicsDevice);
     drawables.Add(pb);
     pworld.Particles.Add(pb.Particle);
 }
Ejemplo n.º 4
0
 void setuprod(ParticleBody pb, ParticleBody pb2, float rodlength)
 {
     pworld.ContactGenerators.Add(new Rod(rodlength, new Particle[] { pb.Particle, pb2.Particle }));
 }