Thursday, April 7, 2011

Bubble Update

added scale to Point struct
added scale to Particle struct

something wired but helpful:
the three structures: Point, Particle and Fluid are independent, but share some basic elements at the head of each. it is kind of like Point is the base class of Particle, and Particle is the base class of Fluid. So each time the elements in Fluid are changed, after the pointer is converted to char* and then to Particle* or Point*, the couterpart will also be updated. I think the shared elements in the three structs must be totally the same, including sequence, so this is kind of dangerous, but the author seemed make use of this property.

anyway, after this, we can draw the bubble particle directly according to its scale, so we can see its expansion vividly. The threshold scale of bubble particle is (0.5, 0.5, 0.5), set up in the emit, search for p->scale.

Also played with buoyancy by impulsing the bubble particles an arbitrary upward force, but remember, z points upward instead of y. Comment it in SPH_ComputeForceGridNC, search for force.z += to avoid it;

No comments:

Post a Comment