summaryrefslogtreecommitdiffstats
path: root/Smoke/fluids.c
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2007-12-20 14:42:30 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2007-12-20 14:42:30 (GMT)
commit94f66fc3270f049202b25d79622f9042a37359eb (patch)
treebc84c53d1b1d02215c0fdabc1fc48288f358e24f /Smoke/fluids.c
parent88a86884cd1664a6820327c1ff8251bedaa947af (diff)
download2iv35-94f66fc3270f049202b25d79622f9042a37359eb.zip
2iv35-94f66fc3270f049202b25d79622f9042a37359eb.tar.gz
2iv35-94f66fc3270f049202b25d79622f9042a37359eb.tar.bz2
rotation seperated from 3D renderer
Diffstat (limited to 'Smoke/fluids.c')
-rw-r--r--Smoke/fluids.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/Smoke/fluids.c b/Smoke/fluids.c
index 4aa4b0e..9ae7d7f 100644
--- a/Smoke/fluids.c
+++ b/Smoke/fluids.c
@@ -54,6 +54,8 @@ float x_rot = 0.0f;
float y_rot = 0.0f;
float z_rot = 0.0f;
+static int fluids_calculate = TRUE;
+
//------ SIMULATION CODE STARTS HERE -----------------------------------------------------------------
//init_simulation: Initialize simulation data structures as a function of the grid size 'n'.
@@ -266,11 +268,13 @@ void copy_frame(fftw_real *field)
void calculate_one_simulation_step(fftw_real *field)
{
- set_forces();
- solve(DIM, vx, vy, vx0, vy0, visc, dt);
- diffuse_matter(DIM, vx, vy, rho, rho0, dt);
- calculate_hight_plot();
- copy_frame(field);
+ if (fluids_calculate) {
+ set_forces();
+ solve(DIM, vx, vy, vx0, vy0, visc, dt);
+ diffuse_matter(DIM, vx, vy, rho, rho0, dt);
+ calculate_hight_plot();
+ copy_frame(field);
+ }
}
//------ VISUALIZATION CODE STARTS HERE -----------------------------------------------------------------
@@ -500,3 +504,13 @@ void set_glyph_sort(int sort)
{
glyph_sort = sort;
}
+
+void fluids_set_calculate(int calculate)
+{
+ fluids_calculate = calculate;
+}
+
+int fluids_get_calculate(void)
+{
+ return fluids_calculate;
+}