diff options
Diffstat (limited to 'intern/smoke/intern/smoke_API.cpp')
-rw-r--r-- | intern/smoke/intern/smoke_API.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp index 2e95a576eaf..058831dddbb 100644 --- a/intern/smoke/intern/smoke_API.cpp +++ b/intern/smoke/intern/smoke_API.cpp @@ -20,7 +20,7 @@ * The Original Code is Copyright (C) 2009 by Daniel Genrich * All rights reserved. * - * Contributor(s): None + * Contributor(s): Daniel Genrich * * ***** END GPL LICENSE BLOCK ***** */ @@ -181,6 +181,36 @@ template < class T > inline T ABS( T a ) { return (0 < a) ? a : -a ; } +extern "C" void smoke_export(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) +{ + *dens = fluid->_density; + *densold = fluid->_densityOld; + *heat = fluid->_heat; + *heatold = fluid->_heatOld; + *vx = fluid->_xVelocity; + *vy = fluid->_yVelocity; + *vz = fluid->_zVelocity; + *vxold = fluid->_xVelocityOld; + *vyold = fluid->_yVelocityOld; + *vzold = fluid->_zVelocityOld; + *obstacles = fluid->_obstacles; + dt = &(fluid->_dt); + dx = &(fluid->_dx); + +} + +extern "C" void smoke_turbulence_export(WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw) +{ + if(!wt) + return; + + *dens = wt->_densityBig; + *densold = wt->_densityBigOld; + *tcu = wt->_tcU; + *tcv = wt->_tcV; + *tcw = wt->_tcW; +} + extern "C" float *smoke_get_density(FLUID_3D *fluid) { return fluid->_density; @@ -193,17 +223,17 @@ extern "C" float *smoke_get_heat(FLUID_3D *fluid) extern "C" float *smoke_get_velocity_x(FLUID_3D *fluid) { - return fluid->_xVorticity; + return fluid->_xVelocity; } extern "C" float *smoke_get_velocity_y(FLUID_3D *fluid) { - return fluid->_yVorticity; + return fluid->_yVelocity; } extern "C" float *smoke_get_velocity_z(FLUID_3D *fluid) { - return fluid->_zVorticity; + return fluid->_zVelocity; } extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt) |