next up previous
Next: Spring Linear Force Up: Force Accumulation Previous: Force Accumulation

Gravity Force

We know from simple physics that on MP which has a mass $m$ a gravity force is equal to $\vec{F} = m \cdot \vec{g}$, where $\vec{g}$ is a gravity vector and $m$ is MP mass. In our two dimensional space we simply update all the forces of all particles to be equal to $(0,g_y)$

/* gravity */
for(i=1 ; i <= NUMP ; ++i)
{
    myPoints[i].fx = 0;
    myPoints[i].fy = MASS * GY * 
      (Pressure - FINAL_PRESSURE >= 0);
}



Maciej Matyka 2004-03-30