PushDown() public méthode

Emulates an object pushing water out of its way (usually down)
public PushDown ( float fx, float fy, float depth ) : void
fx float
fy float
depth float
Résultat void
Exemple #1
0
 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
         }
     }
 }