Ejemplo n.º 1
0
  void flow(VoxelGrid volume) {

    // get the value of the current voxel
    float v = volume.getValue(this);

    // check neighbouring voxels for difference
    Vec3D from = volume.repelFromValue(this, 0, 1, 0.1f).limit(0.1f);
    if (!from.isZeroVector()) {
      lastSub += 1;
    } else {
      lastSub = 0;
    }
    addForce(from);
  }