[Bf-blender-cvs] [520075c] fluid-mantaflow: transferred object velocities to mantaflow

Sebastián Barschkis noreply at git.blender.org
Mon Apr 25 16:24:38 CEST 2016


Commit: 520075c9de938e745a5fac9ffc4a69065bff2364
Author: Sebastián Barschkis
Date:   Mon Apr 25 16:22:14 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB520075c9de938e745a5fac9ffc4a69065bff2364

transferred object velocities to mantaflow

===================================================================

M	intern/mantaflow/intern/MANTA.cpp
M	intern/mantaflow/intern/strings/smoke.h

===================================================================

diff --git a/intern/mantaflow/intern/MANTA.cpp b/intern/mantaflow/intern/MANTA.cpp
index 9bded17..b8e7de3 100644
--- a/intern/mantaflow/intern/MANTA.cpp
+++ b/intern/mantaflow/intern/MANTA.cpp
@@ -78,6 +78,9 @@ MANTA::MANTA(int *res, SmokeModifierData *smd)
 	mVelocityX      = NULL;
 	mVelocityY      = NULL;
 	mVelocityZ      = NULL;
+	mObVelocityX    = NULL;
+	mObVelocityY    = NULL;
+	mObVelocityZ    = NULL;
 	mForceX         = NULL;
 	mForceY         = NULL;
 	mForceZ         = NULL;
@@ -90,11 +93,7 @@ MANTA::MANTA(int *res, SmokeModifierData *smd)
 	mDensityInflow  = NULL;
 	mFuelInflow     = NULL;
 	mMantaFlags     = NULL;
-	mObVelocityX    = new float[mTotalCells];               // TODO in Mantaflow
-	mObVelocityY    = new float[mTotalCells];               // TODO in Mantaflow
-	mObVelocityZ    = new float[mTotalCells];               // TODO in Mantaflow
 	mObstacles      = NULL;
-	mObstaclesAnim  = new unsigned char[mTotalCells];       // TODO in Mantaflow
 	
 	// High res grids
 	mDensityHigh    = NULL;
@@ -295,6 +294,9 @@ MANTA::~MANTA()
 	mVelocityX      = NULL;
 	mVelocityY      = NULL;
 	mVelocityZ      = NULL;
+	mObVelocityX    = NULL;
+	mObVelocityY    = NULL;
+	mObVelocityZ    = NULL;
 	mForceX         = NULL;
 	mForceY         = NULL;
 	mForceZ         = NULL;
@@ -308,11 +310,6 @@ MANTA::~MANTA()
 	mFuelInflow     = NULL;
 	mMantaFlags     = NULL;
 	mObstacles      = NULL;
-
-	if (mObVelocityX)   delete[] mObVelocityX;              // TODO in Mantaflow
-	if (mObVelocityY)   delete[] mObVelocityY;              // TODO in Mantaflow
-	if (mObVelocityZ)   delete[] mObVelocityZ;              // TODO in Mantaflow
-	if (mObstaclesAnim) delete[] mObstaclesAnim;            // TODO in Mantaflow
 	
 	if (mUsingHighRes)
 	{
diff --git a/intern/mantaflow/intern/strings/smoke.h b/intern/mantaflow/intern/strings/smoke.h
index 1ac27bf..90fe470 100644
--- a/intern/mantaflow/intern/strings/smoke.h
+++ b/intern/mantaflow/intern/strings/smoke.h
@@ -89,6 +89,10 @@ vel = s.create(MACGrid)\n\
 x_vel = s.create(RealGrid)\n\
 y_vel = s.create(RealGrid)\n\
 z_vel = s.create(RealGrid)\n\
+obvel = s.create(MACGrid)\n\
+x_obvel = s.create(RealGrid)\n\
+y_obvel = s.create(RealGrid)\n\
+z_obvel = s.create(RealGrid)\n\
 density = s.create(LevelsetGrid)\n\
 pressure = s.create(RealGrid)\n\
 forces = s.create(MACGrid)\n\
@@ -281,6 +285,10 @@ if 'vel' in globals() : del vel\n\
 if 'x_vel' in globals() : del x_vel\n\
 if 'y_vel' in globals() : del y_vel\n\
 if 'z_vel' in globals() : del z_vel\n\
+if 'obvel' in globals() : del obvel\n\
+if 'x_obvel' in globals() : del x_obvel\n\
+if 'y_obvel' in globals() : del y_obvel\n\
+if 'z_obvel' in globals() : del z_obvel\n\
 if 'density' in globals() : del density\n\
 if 'pressure' in globals() : del pressure\n\
 if 'forces' in globals() : del forces\n\
@@ -383,6 +391,7 @@ const std::string smoke_step_low = "\n\
 def step_low():\n\
   mantaMsg('Step low')\n\
   copyRealToVec3(sourceX=x_vel, sourceY=y_vel, sourceZ=z_vel, target=vel)\n\
+  copyRealToVec3(sourceX=x_obvel, sourceY=y_obvel, sourceZ=z_obvel, target=obvel)\n\
   if dim == 2:\n\
     density.add(inflow_grid)\n\
   \n\
@@ -436,6 +445,7 @@ def step_low():\n\
   solvePressure(flags=flags, vel=vel, pressure=pressure)\n\
   \n\
   copyVec3ToReal(source=vel, targetX=x_vel, targetY=y_vel, targetZ=z_vel)\n\
+  copyVec3ToReal(source=obvel, targetX=x_obvel, targetY=y_obvel, targetZ=z_obvel)\n\
 \n\
 def process_burn_low():\n\
   mantaMsg('Process burn low')\n\




More information about the Bf-blender-cvs mailing list