diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-03 14:58:08 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2008-01-03 14:58:08 (GMT) |
commit | 747c680560744a021f1b99455db33f906970c3fe (patch) | |
tree | 6b7cf0ec59e1e399b060ca16e657249f8c5add32 /Smoke/fluids.c | |
parent | e1b9274194fcb0e5054948917628c5e1022b42c2 (diff) | |
download | 2iv35-747c680560744a021f1b99455db33f906970c3fe.zip 2iv35-747c680560744a021f1b99455db33f906970c3fe.tar.gz 2iv35-747c680560744a021f1b99455db33f906970c3fe.tar.bz2 |
dataset selection buttons now work
Diffstat (limited to 'Smoke/fluids.c')
-rw-r--r-- | Smoke/fluids.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Smoke/fluids.c b/Smoke/fluids.c index 5e1f7a6..2223bde 100644 --- a/Smoke/fluids.c +++ b/Smoke/fluids.c @@ -36,7 +36,7 @@ rfftwnd_plan plan_rc, plan_cr; //simulation domain discretization int winWidth, winHeight; //size of the graphics window, in pixels int color_dir = 0; //use direction color-coding or not float vec_scale = 1000; //scaling of hedgehogs -int vis_dataset = DATASET_RHO; +int vis_dataset = DATASET_VEL; int active_slider = 0; int glyph_scalar = SCALAR_RHO; int glyph_vector = VECTOR_VEL; @@ -339,9 +339,9 @@ void calculate_height_plot(void) } } -void copy_frame(fftw_real *field) +void copy_frame(fftw_real *field, fftw_real *dataset) { - memcpy(field, rho, DIM * 2 * (DIM / 2 + 1) * sizeof(fftw_real)); + memcpy(field, dataset, DIM * 2 * (DIM / 2 + 1) * sizeof(fftw_real)); } //do_one_simulation_step: Do one complete cycle of the simulation: @@ -359,7 +359,7 @@ void calculate_one_simulation_step(fftw_real *field) diffuse_matter(DIM, vx, vy, rho, rho0, dt); calculate_height_plot(); calculate_normal_vectors(); - copy_frame(field); + copy_frame(field, rho); } } @@ -410,10 +410,10 @@ float get_dataset(int index) switch (vis_dataset) { case DATASET_FORCE: - return_value = (float)quake_root((fx[index] * fx[index]) + (fy[index] * fy[index])); + return_value = vec_len2f(fx[index], fy[index]); break; case DATASET_VEL: - return_value = (float)quake_root((vx[index] * vx[index]) + (vy[index] * vy[index])); + return_value = vec_len2f(vx[index], vy[index]); break; default: case DATASET_RHO: |