Blender V2.61 - r43446

DNA_smoke_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2006 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): Daniel Genrich (Genscher)
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00032 #ifndef DNA_SMOKE_TYPES_H
00033 #define DNA_SMOKE_TYPES_H
00034 
00035 /* flags */
00036 #define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */
00037 #define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */
00038 #define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */
00039 
00040 #define MOD_SMOKE_HIGH_SMOOTH (1<<5) /* smoothens high res emission*/
00041 #define MOD_SMOKE_FILE_LOAD (1<<6) /* flag for file load */
00042 
00043 /* noise */
00044 #define MOD_SMOKE_NOISEWAVE (1<<0)
00045 #define MOD_SMOKE_NOISEFFT (1<<1)
00046 #define MOD_SMOKE_NOISECURL (1<<2)
00047 /* viewsettings */
00048 #define MOD_SMOKE_VIEW_SHOWBIG (1<<0)
00049 
00050 /* cache compression */
00051 #define SM_CACHE_LIGHT      0
00052 #define SM_CACHE_HEAVY      1
00053 
00054 /* domain border collision */
00055 #define SM_BORDER_OPEN      0
00056 #define SM_BORDER_VERTICAL  1
00057 #define SM_BORDER_CLOSED    2
00058 
00059 typedef struct SmokeDomainSettings {
00060     struct SmokeModifierData *smd; /* for fast RNA access */
00061     struct FLUID_3D *fluid;
00062     struct Group *fluid_group;
00063     struct Group *eff_group; // UNUSED
00064     struct Group *coll_group; // collision objects group
00065     struct WTURBULENCE *wt; // WTURBULENCE object, if active
00066     struct GPUTexture *tex;
00067     struct GPUTexture *tex_wt;
00068     struct GPUTexture *tex_shadow;
00069     float *shadow;
00070     float p0[3]; /* start point of BB */
00071     float p1[3]; /* end point of BB */
00072     float dx; /* edge length of one cell */
00073     float omega; /* smoke color - from 0 to 1 */
00074     float temp; /* fluid temperature */
00075     float tempAmb; /* ambient temperature */
00076     float alpha;
00077     float beta;
00078     int res[3]; /* domain resolution */
00079     int amplify; /* wavelet amplification */
00080     int maxres; /* longest axis on the BB gets this resolution assigned */
00081     int flags; /* show up-res or low res, etc */
00082     int pad; 
00083     int viewsettings;
00084     short noise; /* noise type: wave, curl, anisotropic */
00085     short diss_percent; 
00086     int diss_speed;/* in frames */
00087     float strength;
00088     int res_wt[3];
00089     float dx_wt;
00090     int v3dnum;
00091     int cache_comp;
00092     int cache_high_comp;
00093 
00094     /* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading old files. */
00095     struct PointCache *point_cache[2];  /* definition is in DNA_object_force.h */
00096     struct ListBase ptcaches[2];
00097     struct EffectorWeights *effector_weights;
00098     int border_collisions;  /* How domain border collisions are handled */
00099     float time_scale;
00100     float vorticity;
00101     int pad2;
00102 } SmokeDomainSettings;
00103 
00104 
00105 /* inflow / outflow */
00106 
00107 /* type */
00108 #define MOD_SMOKE_FLOW_TYPE_OUTFLOW (1<<1)
00109 
00110 /* flags */
00111 #define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
00112 #define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to
00113                                          the smoke*/
00114 
00115 
00116 typedef struct SmokeFlowSettings {
00117     struct SmokeModifierData *smd; /* for fast RNA access */
00118     struct ParticleSystem *psys;
00119     float density;
00120     float temp; /* delta temperature (temp - ambient temp) */
00121     float velocity[2]; /* UNUSED, velocity taken from particles */
00122     float vel_multi; // Multiplier for particle velocity
00123     float vgrp_heat_scale[2]; /* min and max scaling for vgroup_heat */
00124     short vgroup_flow; /* where inflow/outflow happens - red=1=action */
00125     short vgroup_density;
00126     short vgroup_heat;
00127     short type; /* inflow =0 or outflow = 1 */
00128     int flags; /* absolute emission etc*/
00129 } SmokeFlowSettings;
00130 
00131 /*
00132     struct BVHTreeFromMesh *bvh;
00133     float mat[4][4];
00134     float mat_old[4][4];
00135     */
00136 
00137 /* collision objects (filled with smoke) */
00138 typedef struct SmokeCollSettings {
00139     struct SmokeModifierData *smd; /* for fast RNA access */
00140     struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
00141     struct DerivedMesh *dm;
00142     float *points;
00143     float *points_old;
00144     float *vel;
00145     float mat[4][4];
00146     float mat_old[4][4];
00147     int numpoints;
00148     int numverts; // check if mesh changed
00149     short type; // static = 0, rigid = 1, dynamic = 2
00150     short pad;
00151     int pad2;
00152 } SmokeCollSettings;
00153 
00154 #endif