Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/mantaflow/preprocessed/plugin/flip.cpp')
-rw-r--r--extern/mantaflow/preprocessed/plugin/flip.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/extern/mantaflow/preprocessed/plugin/flip.cpp b/extern/mantaflow/preprocessed/plugin/flip.cpp
index 4dfeff1d0ac..8ac167c1166 100644
--- a/extern/mantaflow/preprocessed/plugin/flip.cpp
+++ b/extern/mantaflow/preprocessed/plugin/flip.cpp
@@ -18,6 +18,7 @@
******************************************************************************/
#include "particle.h"
+#include "general.h"
#include "grid.h"
#include "commonkernels.h"
#include "randomstream.h"
@@ -1429,9 +1430,9 @@ struct correctLevelset : public KernelBase {
Real t = (t_high - maxEV) / (t_high - t_low);
correction = t * t * t - 3 * t * t + 3 * t;
}
- correction = (correction < 0) ?
- 0 :
- correction; // enforce correction factor to [0,1] (not explicitly in paper)
+ correction = clamp(correction,
+ Real(0),
+ Real(1)); // enforce correction factor to [0,1] (not explicitly in paper)
const Vec3 gridPos = Vec3(i, j, k) + Vec3(0.5); // shifted by half cell
const Real correctedPhi = fabs(norm(gridPos - pAcc(i, j, k))) - rAcc(i, j, k) * correction;