Blender  V2.59
smoke_API.h
Go to the documentation of this file.
00001 /*
00002  * $Id: smoke_API.h 35159 2011-02-25 11:50:46Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2009 by Daniel Genrich
00021  * All rights reserved.
00022  *
00023  * Contributor(s): Daniel Genrich
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #ifndef SMOKE_API_H_
00034 #define SMOKE_API_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 struct FLUID_3D;
00041 
00042 // export
00043 void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles);
00044 
00045 // low res
00046 struct FLUID_3D *smoke_init(int *res, float *p0);
00047 void smoke_free(struct FLUID_3D *fluid);
00048 
00049 void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli);
00050 void smoke_step(struct FLUID_3D *fluid, size_t framenr, float fps);
00051 
00052 float *smoke_get_density(struct FLUID_3D *fluid);
00053 float *smoke_get_heat(struct FLUID_3D *fluid);
00054 float *smoke_get_velocity_x(struct FLUID_3D *fluid);
00055 float *smoke_get_velocity_y(struct FLUID_3D *fluid);
00056 float *smoke_get_velocity_z(struct FLUID_3D *fluid);
00057 
00058 float *smoke_get_force_x(struct FLUID_3D *fluid);
00059 float *smoke_get_force_y(struct FLUID_3D *fluid);
00060 float *smoke_get_force_z(struct FLUID_3D *fluid);
00061 
00062 unsigned char *smoke_get_obstacle(struct FLUID_3D *fluid);
00063 
00064 size_t smoke_get_index(int x, int max_x, int y, int max_y, int z);
00065 size_t smoke_get_index2d(int x, int max_x, int y);
00066 
00067 void smoke_dissolve(struct FLUID_3D *fluid, int speed, int log);
00068 
00069 // wavelet turbulence functions
00070 struct WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype);
00071 void smoke_turbulence_free(struct WTURBULENCE *wt);
00072 void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
00073 
00074 float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
00075 void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res);
00076 void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
00077 void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength);
00078 
00079 void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log);
00080 
00081 // export
00082 void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw);
00083 
00084 #ifdef __cplusplus
00085 }
00086 #endif
00087 
00088 #endif /* SMOKE_API_H_ */