2011-02-17 21:48:12 +01:00
|
|
|
/*
|
2011-10-23 19:52:20 +02:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2006 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): Daniel Genrich (Genscher)
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
2009-07-30 17:00:26 +02:00
|
|
|
|
2011-02-17 21:48:12 +01:00
|
|
|
/** \file DNA_smoke_types.h
|
|
|
|
* \ingroup DNA
|
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __DNA_SMOKE_TYPES_H__
|
|
|
|
#define __DNA_SMOKE_TYPES_H__
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2009-07-30 17:00:26 +02:00
|
|
|
/* flags */
|
2009-08-20 02:33:59 +02:00
|
|
|
#define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */
|
2009-08-12 19:32:02 +02:00
|
|
|
#define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */
|
2009-08-26 02:38:43 +02:00
|
|
|
#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
|
|
|
|
#define MOD_SMOKE_HIGH_SMOOTH (1<<5) /* smoothens high res emission*/
|
2010-11-23 15:04:05 +01:00
|
|
|
#define MOD_SMOKE_FILE_LOAD (1<<6) /* flag for file load */
|
2009-08-25 23:53:52 +02:00
|
|
|
|
|
|
|
/* noise */
|
|
|
|
#define MOD_SMOKE_NOISEWAVE (1<<0)
|
|
|
|
#define MOD_SMOKE_NOISEFFT (1<<1)
|
|
|
|
#define MOD_SMOKE_NOISECURL (1<<2)
|
2009-07-30 17:00:26 +02:00
|
|
|
/* viewsettings */
|
2009-09-09 20:39:40 +02:00
|
|
|
#define MOD_SMOKE_VIEW_SHOWBIG (1<<0)
|
2009-07-30 17:00:26 +02:00
|
|
|
|
2010-01-25 16:10:14 +01:00
|
|
|
/* cache compression */
|
|
|
|
#define SM_CACHE_LIGHT 0
|
|
|
|
#define SM_CACHE_HEAVY 1
|
|
|
|
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
/* domain border collision */
|
|
|
|
#define SM_BORDER_OPEN 0
|
|
|
|
#define SM_BORDER_VERTICAL 1
|
|
|
|
#define SM_BORDER_CLOSED 2
|
|
|
|
|
2012-04-28 23:46:43 +02:00
|
|
|
/* collision types */
|
|
|
|
#define SM_COLL_STATIC 0
|
|
|
|
#define SM_COLL_RIGID 1
|
|
|
|
#define SM_COLL_ANIMATED 2
|
|
|
|
|
2009-07-30 17:00:26 +02:00
|
|
|
typedef struct SmokeDomainSettings {
|
|
|
|
struct SmokeModifierData *smd; /* for fast RNA access */
|
|
|
|
struct FLUID_3D *fluid;
|
|
|
|
struct Group *fluid_group;
|
2009-10-08 12:18:14 +02:00
|
|
|
struct Group *eff_group; // UNUSED
|
2009-07-30 17:00:26 +02:00
|
|
|
struct Group *coll_group; // collision objects group
|
2009-09-09 20:39:40 +02:00
|
|
|
struct WTURBULENCE *wt; // WTURBULENCE object, if active
|
2009-08-20 02:33:59 +02:00
|
|
|
struct GPUTexture *tex;
|
2009-09-09 20:39:40 +02:00
|
|
|
struct GPUTexture *tex_wt;
|
|
|
|
struct GPUTexture *tex_shadow;
|
|
|
|
float *shadow;
|
2009-07-30 17:00:26 +02:00
|
|
|
float p0[3]; /* start point of BB */
|
|
|
|
float p1[3]; /* end point of BB */
|
|
|
|
float dx; /* edge length of one cell */
|
2009-09-09 20:39:40 +02:00
|
|
|
float omega; /* smoke color - from 0 to 1 */
|
2009-07-30 17:00:26 +02:00
|
|
|
float temp; /* fluid temperature */
|
|
|
|
float tempAmb; /* ambient temperature */
|
|
|
|
float alpha;
|
|
|
|
float beta;
|
|
|
|
int res[3]; /* domain resolution */
|
2009-09-09 20:39:40 +02:00
|
|
|
int amplify; /* wavelet amplification */
|
2009-07-30 17:00:26 +02:00
|
|
|
int maxres; /* longest axis on the BB gets this resolution assigned */
|
|
|
|
int flags; /* show up-res or low res, etc */
|
2009-09-09 20:39:40 +02:00
|
|
|
int pad;
|
2009-07-30 17:00:26 +02:00
|
|
|
int viewsettings;
|
2009-09-09 20:39:40 +02:00
|
|
|
short noise; /* noise type: wave, curl, anisotropic */
|
2009-08-12 19:32:02 +02:00
|
|
|
short diss_percent;
|
|
|
|
int diss_speed;/* in frames */
|
2009-08-25 23:53:52 +02:00
|
|
|
float strength;
|
|
|
|
int res_wt[3];
|
2009-09-09 20:39:40 +02:00
|
|
|
float dx_wt;
|
|
|
|
int v3dnum;
|
2010-01-25 16:10:14 +01:00
|
|
|
int cache_comp;
|
|
|
|
int cache_high_comp;
|
2010-11-30 22:31:18 +01:00
|
|
|
|
|
|
|
/* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading old files. */
|
2009-09-09 20:39:40 +02:00
|
|
|
struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */
|
|
|
|
struct ListBase ptcaches[2];
|
2009-10-08 12:18:14 +02:00
|
|
|
struct EffectorWeights *effector_weights;
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
int border_collisions; /* How domain border collisions are handled */
|
|
|
|
float time_scale;
|
|
|
|
float vorticity;
|
|
|
|
int pad2;
|
2009-07-30 17:00:26 +02:00
|
|
|
} SmokeDomainSettings;
|
|
|
|
|
2009-08-03 01:30:44 +02:00
|
|
|
|
2009-07-30 17:00:26 +02:00
|
|
|
/* inflow / outflow */
|
2009-08-03 01:30:44 +02:00
|
|
|
|
|
|
|
/* type */
|
|
|
|
#define MOD_SMOKE_FLOW_TYPE_OUTFLOW (1<<1)
|
|
|
|
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
/* flags */
|
|
|
|
#define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
|
2012-03-09 19:28:30 +01:00
|
|
|
#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to the smoke */
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
|
2009-07-30 17:00:26 +02:00
|
|
|
typedef struct SmokeFlowSettings {
|
|
|
|
struct SmokeModifierData *smd; /* for fast RNA access */
|
|
|
|
struct ParticleSystem *psys;
|
|
|
|
float density;
|
|
|
|
float temp; /* delta temperature (temp - ambient temp) */
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
float velocity[2]; /* UNUSED, velocity taken from particles */
|
|
|
|
float vel_multi; // Multiplier for particle velocity
|
2009-07-30 17:00:26 +02:00
|
|
|
float vgrp_heat_scale[2]; /* min and max scaling for vgroup_heat */
|
|
|
|
short vgroup_flow; /* where inflow/outflow happens - red=1=action */
|
|
|
|
short vgroup_density;
|
|
|
|
short vgroup_heat;
|
|
|
|
short type; /* inflow =0 or outflow = 1 */
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 16:53:20 +02:00
|
|
|
int flags; /* absolute emission etc*/
|
2009-07-30 17:00:26 +02:00
|
|
|
} SmokeFlowSettings;
|
|
|
|
|
2012-03-09 19:28:30 +01:00
|
|
|
|
|
|
|
// struct BVHTreeFromMesh *bvh;
|
|
|
|
// float mat[4][4];
|
|
|
|
// float mat_old[4][4];
|
2009-08-12 19:32:02 +02:00
|
|
|
|
2009-07-30 17:00:26 +02:00
|
|
|
/* collision objects (filled with smoke) */
|
|
|
|
typedef struct SmokeCollSettings {
|
|
|
|
struct SmokeModifierData *smd; /* for fast RNA access */
|
2009-08-03 18:39:12 +02:00
|
|
|
struct BVHTree *bvhtree; /* bounding volume hierarchy for this cloth object */
|
2009-07-30 17:00:26 +02:00
|
|
|
float *points;
|
|
|
|
float *points_old;
|
2012-04-28 23:46:43 +02:00
|
|
|
float *vel; // UNUSED
|
|
|
|
int *tridivs;
|
2009-07-30 17:00:26 +02:00
|
|
|
float mat[4][4];
|
|
|
|
float mat_old[4][4];
|
|
|
|
int numpoints;
|
|
|
|
int numverts; // check if mesh changed
|
2012-04-28 23:46:43 +02:00
|
|
|
int numtris;
|
|
|
|
float dx; /* global domain cell length taken from (scale / resolution) */
|
2009-07-30 17:00:26 +02:00
|
|
|
short type; // static = 0, rigid = 1, dynamic = 2
|
|
|
|
short pad;
|
|
|
|
int pad2;
|
|
|
|
} SmokeCollSettings;
|
|
|
|
|
|
|
|
#endif
|