protected void ProcessRain()
{
foreach ( Particle p in particleSystem.Particles )
{
Vector3 ppos = p.Position;
if ( ppos.y <= 0 && p.timeToLive > 0 )
{
// hits the water!
p.timeToLive = 0.0f; // delete particle
// push the water
float x = ppos.x / PLANE_SIZE * CMPLX;
float y = ppos.z / PLANE_SIZE * CMPLX;
float h = (float)RAND.NextDouble() % RAIN_HEIGHT_RANDOM + RAIN_HEIGHT_CONSTANT * 2;
if ( x < 1 )
x = 1;
if ( x > CMPLX - 1 )
x = CMPLX - 1;
if ( y < 1 )
y = 1;
if ( y > CMPLX - 1 )
y = CMPLX - 1;
waterMesh.PushDown( x, y, -h );
//TODO: to implement WaterCircles, this is where you would create each new WaterCircle
}
}
}