5 * ***** BEGIN GPL LICENSE BLOCK *****
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * The Original Code is Copyright (C) 2004-2005 by Blender Foundation
22 * All rights reserved.
24 * The Original Code is: all of this file.
26 * Contributor(s): none yet.
28 * ***** END GPL LICENSE BLOCK *****
30 #ifndef DNA_OBJECT_FLUIDSIM_H
31 #define DNA_OBJECT_FLUIDSIM_H
33 /** \file DNA_object_fluidsim.h
47 typedef struct FluidsimSettings {
48 struct FluidsimModifierData *fmd; /* for fast RNA access */
49 /* domain,fluid or obstacle */
51 /* display advanced options in fluid sim tab (on=1,off=0)*/
52 short show_advancedoptions;
54 /* domain object settings */
58 /* size of the domain in real units (meters along largest resolution x,y,z extent) */
60 /* show original meshes, preview or final sim */
62 short renderDisplayMode;
64 /* fluid properties */
67 short viscosityExponent;
68 /* gravity strength */
69 float gravx,gravy,gravz;
70 /* anim start end time (in seconds) */
71 float animStart, animEnd;
72 /* bake start end time (in blender frames) */
73 int bakeStart, bakeEnd;
74 /* g star param (LBM compressibility) */
76 /* activate refinement? */
79 /* fluid object type settings */
80 /* gravity strength */
81 float iniVelx,iniVely,iniVelz;
83 /* store pointer to original mesh (for replacing the current one) */
85 /* pointer to the currently loaded fluidsim mesh */
86 struct Mesh *meshSurface;
87 /* a mesh to display the bounding box used for simulation */
90 /* store output path, and file prefix for baked fluid surface */
91 /* strlens; 80= FILE_MAXFILE, 160= FILE_MAXDIR */
92 char surfdataPath[240];
94 /* store start coords of axis aligned bounding box together with size */
95 /* values are inited during derived mesh display */
96 float bbStart[3], bbSize[3];
101 /* additional flags depending on the type, lower short contains flags
102 * to check validity, higher short additional flags */
104 /* switch off velocity genration, volume init type for fluid/obstacles (volume=1,shell=2,both=3) */
105 char domainNovecgen,volumeInitType;
107 /* boundary "stickiness" for part slip values */
110 /* number of tracers to generate */
112 /* particle generation - on if >0, then determines amount (experimental...) */
113 float generateParticles;
114 /* smooth fluid surface? */
115 float surfaceSmoothing;
116 /* number of surface subdivisions*/
118 int flag; /* GUI flags */
120 /* particle display - size scaling, and alpha influence */
121 float particleInfSize, particleInfAlpha;
125 /* save fluidsurface normals in mvert.no, and surface vertex velocities (if available) in mvert.co */
126 struct MVert *meshSurfNormals;
128 /* Fluid control settings */
133 float attractforceStrength;
134 float attractforceRadius;
135 float velocityforceStrength;
136 float velocityforceRadius;
142 /* ob->fluidsimSettings defines */
143 #define OB_FLUIDSIM_ENABLE 1
144 #define OB_FLUIDSIM_DOMAIN 2
145 #define OB_FLUIDSIM_FLUID 4
146 #define OB_FLUIDSIM_OBSTACLE 8
147 #define OB_FLUIDSIM_INFLOW 16
148 #define OB_FLUIDSIM_OUTFLOW 32
149 #define OB_FLUIDSIM_PARTICLE 64
150 #define OB_FLUIDSIM_CONTROL 128
152 #define OB_TYPEFLAG_START 7
153 #define OB_FSGEO_THIN (1<<(OB_TYPEFLAG_START+1))
154 #define OB_FSBND_NOSLIP (1<<(OB_TYPEFLAG_START+2))
155 #define OB_FSBND_PARTSLIP (1<<(OB_TYPEFLAG_START+3))
156 #define OB_FSBND_FREESLIP (1<<(OB_TYPEFLAG_START+4))
157 #define OB_FSINFLOW_LOCALCOORD (1<<(OB_TYPEFLAG_START+5))
159 // guiDisplayMode particle flags
160 #define OB_FSDOM_GEOM 1
161 #define OB_FSDOM_PREVIEW 2
162 #define OB_FSDOM_FINAL 3
163 #define OB_FSPART_BUBBLE (1<<1)
164 #define OB_FSPART_DROP (1<<2)
165 #define OB_FSPART_NEWPART (1<<3)
166 #define OB_FSPART_FLOAT (1<<4)
167 #define OB_FSPART_TRACER (1<<5)
169 // new fluid bit flags for fss->flags
170 #define OB_FLUIDSIM_REVERSE (1 << 0)
171 #define OB_FLUIDSIM_ACTIVE (1 << 1)
172 #define OB_FLUIDSIM_OVERRIDE_TIME (1 << 2)