diff options
Diffstat (limited to 'intern/smoke/intern/WTURBULENCE.cpp')
-rw-r--r-- | intern/smoke/intern/WTURBULENCE.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp index cd18cf7b344..83bec466c9f 100644 --- a/intern/smoke/intern/WTURBULENCE.cpp +++ b/intern/smoke/intern/WTURBULENCE.cpp @@ -431,8 +431,11 @@ void WTURBULENCE::decomposeEnergy(float *_energy, float *_highFreqEnergy) // compute velocity from energies and march into obstacles // for wavelet decomposition ////////////////////////////////////////////////////////////////////// -void WTURBULENCE::computeEnergy(float *_energy, float* xvel, float* yvel, float* zvel, unsigned char *obstacles) +void WTURBULENCE::computeEnergy(float *_energy, float* xvel, float* yvel, float* zvel, unsigned char *origObstacles) { + unsigned char *obstacles = new unsigned char[_totalCellsSm]; + memcpy(obstacles, origObstacles, sizeof(unsigned char) * _totalCellsSm); + // compute everywhere for (int x = 0; x < _totalCellsSm; x++) _energy[x] = 0.5f * (xvel[x] * xvel[x] + yvel[x] * yvel[x] + zvel[x] * zvel[x]); @@ -506,7 +509,9 @@ void WTURBULENCE::computeEnergy(float *_energy, float* xvel, float* yvel, float* for (int y = 1; y < _yResSm - 1; y++, index += 2) for (int x = 1; x < _xResSm - 1; x++, index++) if (obstacles[index]) - obstacles[index] = 1; + obstacles[index] = 1; // DG TODO ? animated obstacle flag? + + free(obstacles); } ////////////////////////////////////////////////////////////////////////////////////////// |