Wind
Wind is a bit like gravity, but not quite. A particle will not accelerate constantly in the
direction of the wind. It cannot accelerate to any faster than the wind. The acceleration of the particle
depends on the difference in velocity between the particle and the wind. If the particle is
traveling against the wind, then it will accelerate more than if it is traveling in the
direction of the wind. Also, if it is moving faster than the wind, then it will slow down to
eventually match the speed. I have a feeling that the force on the particle is proportional to
the difference in speed to the power 1.5 but im not sure, and I'll assume that the power is just
1.
So you add another bit to the particle loop:
horizontal_force = (wind_velocity - x_velocity) * some_small_value
Now just apply the force to the x_velocity of the particle in the same way as the gravity. Now,
you may notice that there is no vertical wind. But the y_velocity of the particle should still
be affected by this:
vertical_force = (0 - y_velocity) * some_small_value
You could have a vertical wind if you wanted. For example, there could be jets of gas comming
up through the ground at certain points. So when a particle enters a jet of gas, you would make
the vertical wind really strong so it gets blown upwards.
This is a good thing to have. Even if you set the wind to be zero in both directions, the
particles will be affected by air resistance, and they will have a terminal velocity just like
real life! cor! Objects falling through a fluid (water, air) will stop accelerating at a certain
speed. For parachutists it's about 200mph. You don't stop accelerating suddenly, your acceleration
decreases gradually upto the terminal velocity at which point it is zero. This is because the
air resistance increases with speed, and at the T.V. the two forces are equal and opposite and
so cancel out.