Ejemplo n.º 1
0
 /// <summary>
 /// Builds a particle system with gravity and viscous drag forces. This particle system interacts with the mouse.
 /// </summary>
 /// <returns>The newly built particle system.</returns>
 public static ParticleSystem BuildParticleSystem()
 {
     ParticleSystem ps = new ParticleSystem();
     ps.AddForce(new GravityForce(ps));
     ps.AddForce(new ViscousDragForce(ps));
     ps.AddForce(new MouseSpringForce(ps));
     return ps;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a new gravity force.
 /// </summary>
 /// <param name="PS">The particle system affected by this gravity force.</param>
 public GravityForce(ParticleSystem PS)
 {
     this.PS = PS;
     forceVector = Constants.Physics.GRAVITY_MAGNITUDE * Constants.Physics.GRAVITY_DIRECTION;
 }
Ejemplo n.º 3
0
 public MouseSpringForce(ParticleSystem PS) { this.PS = PS; }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a new drag force.
 /// </summary>
 /// <param name="PS">A particle system containing affected particles.</param>
 public ViscousDragForce(ParticleSystem PS)
 {
     this.PS = PS;
 }