[Bf-blender-cvs] [d2ef009] fluid-mantaflow: first customizations for using mantafow flags grid (replaces obstacle grid / array in blender)

Sebastián Barschkis noreply at git.blender.org
Fri Apr 1 22:13:37 CEST 2016


Commit: d2ef009a65a7848266de63e15787d03abbfd93b3
Author: Sebastián Barschkis
Date:   Thu Mar 31 22:13:28 2016 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBd2ef009a65a7848266de63e15787d03abbfd93b3

first customizations for using mantafow flags grid (replaces obstacle grid / array in blender)

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

M	intern/mantaflow/intern/MANTA.cpp

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

diff --git a/intern/mantaflow/intern/MANTA.cpp b/intern/mantaflow/intern/MANTA.cpp
index 7f8d826..d9ecd47 100644
--- a/intern/mantaflow/intern/MANTA.cpp
+++ b/intern/mantaflow/intern/MANTA.cpp
@@ -93,7 +93,7 @@ MANTA::MANTA(int *res, SmokeModifierData *smd)
 	mObVelocityX    = new float[mTotalCells];               // TODO in Mantaflow
 	mObVelocityY    = new float[mTotalCells];               // TODO in Mantaflow
 	mObVelocityZ    = new float[mTotalCells];               // TODO in Mantaflow
-	mObstacles      = new unsigned char[mTotalCells];       // TODO in Mantaflow
+	mObstacles      = NULL;
 	mObstaclesAnim  = new unsigned char[mTotalCells];       // TODO in Mantaflow
 	
 	// High res grids
@@ -110,10 +110,6 @@ MANTA::MANTA(int *res, SmokeModifierData *smd)
 	mTextureU2      = NULL;
 	mTextureV2      = NULL;
 	mTextureW2      = NULL;
-	
-	// TODO: Obstacle grid not mantaflow optimized
-	for (int x = 0; x < mTotalCells; x++)
-		mObstacles[x] = false;
 
 	if (!mantaInitialized)
 		startMantaflow();
@@ -306,11 +302,11 @@ MANTA::~MANTA()
 	mDensityInflow  = NULL;
 	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 (mObstacles)     delete[] mObstacles;                // TODO in Mantaflow
 	if (mObstaclesAnim) delete[] mObstaclesAnim;            // TODO in Mantaflow
 	
 	if (mUsingHighRes)
@@ -655,6 +651,7 @@ void MANTA::updatePointers(SmokeModifierData *smd)
 	mForceZ         = (float*) pointerFromString( getGridPointer("z_force",    "s") );
 	mDensityInflow  = (float*) pointerFromString( getGridPointer("inflow_grid","s") );
 	mFuelInflow     = (float*) pointerFromString( getGridPointer("fuel_inflow","s") );
+	mObstacles      = (unsigned char*) pointerFromString( getGridPointer("flags",      "s") );
 	
 	if (mUsingHeat) {
 		mHeat       = (float*) pointerFromString(getGridPointer("heat",        "s") );




More information about the Bf-blender-cvs mailing list