diff options
Diffstat (limited to 'extern/mantaflow/preprocessed/plugin')
4 files changed, 20 insertions, 21 deletions
diff --git a/extern/mantaflow/preprocessed/plugin/flip.cpp b/extern/mantaflow/preprocessed/plugin/flip.cpp index eaa1ebe45d5..d6fd3437959 100644 --- a/extern/mantaflow/preprocessed/plugin/flip.cpp +++ b/extern/mantaflow/preprocessed/plugin/flip.cpp @@ -429,7 +429,7 @@ void markFluidCells(const BasicParticleSystem &parts, for (IndexInt idx = 0; idx < parts.size(); idx++) { if (!parts.isActive(idx) || (ptype && ((*ptype)[idx] & exclude))) continue; - Vec3i p = toVec3i(parts.getPos(idx)); + Vec3i p = toVec3iFloor(parts.getPos(idx)); if (flags.isInBounds(p) && flags.isEmpty(p)) flags(p) = (flags(p) | FlagGrid::TypeFluid) & ~FlagGrid::TypeEmpty; } @@ -544,7 +544,7 @@ void adjustNumber(BasicParticleSystem &parts, // count particles in cells, and delete excess particles for (IndexInt idx = 0; idx < (int)parts.size(); idx++) { if (parts.isActive(idx)) { - Vec3i p = toVec3i(parts.getPos(idx)); + Vec3i p = toVec3iFloor(parts.getPos(idx)); if (!tmp.isInBounds(p)) { parts.kill(idx); // out of domain, remove continue; @@ -711,7 +711,7 @@ void gridParticleIndex(const BasicParticleSystem &parts, for (IndexInt idx = 0; idx < (IndexInt)parts.size(); idx++) { if (parts.isActive(idx)) { // check index for validity... - Vec3i p = toVec3i(parts.getPos(idx)); + Vec3i p = toVec3iFloor(parts.getPos(idx)); if (!index.isInBounds(p)) { inactive++; continue; @@ -740,7 +740,7 @@ void gridParticleIndex(const BasicParticleSystem &parts, for (IndexInt idx = 0; idx < (IndexInt)parts.size(); idx++) { if (!parts.isActive(idx)) continue; - Vec3i p = toVec3i(parts.getPos(idx)); + Vec3i p = toVec3iFloor(parts.getPos(idx)); if (!index.isInBounds(p)) { continue; } @@ -1636,7 +1636,7 @@ struct knPushOutofObs : public KernelBase { { if (!parts.isActive(idx) || (ptype && ((*ptype)[idx] & exclude))) return; - Vec3i p = toVec3i(parts.getPos(idx)); + Vec3i p = toVec3iFloor(parts.getPos(idx)); if (!flags.isInBounds(p)) return; diff --git a/extern/mantaflow/preprocessed/plugin/initplugins.cpp b/extern/mantaflow/preprocessed/plugin/initplugins.cpp index dce7b72de6c..a0cc2761dab 100644 --- a/extern/mantaflow/preprocessed/plugin/initplugins.cpp +++ b/extern/mantaflow/preprocessed/plugin/initplugins.cpp @@ -2278,7 +2278,7 @@ T convolveGrid(Grid<T> &originGrid, GaussianKernelCreator &gkSigma, Vec3 pos, in step = Vec3(0.0, 0.0, 1.0); T pxResult(0); for (int i = 0; i < gkSigma.mDim; ++i) { - Vec3i curpos = toVec3i(pos - step * (i - gkSigma.mDim / 2)); + Vec3i curpos = toVec3iFloor(pos - step * (i - gkSigma.mDim / 2)); if (originGrid.isInBounds(curpos)) pxResult += gkSigma.get1DKernelValue(i) * originGrid.get(curpos); else { // TODO , improve... @@ -2423,7 +2423,7 @@ struct KnBlurMACGridGauss : public KernelBase { Vec3 pxResult(0.0f); for (int di = 0; di < gkSigma.mDim; ++di) { - Vec3i curpos = toVec3i(pos - step * (di - gkSigma.mDim / 2)); + Vec3i curpos = toVec3iFloor(pos - step * (di - gkSigma.mDim / 2)); if (!originGrid.isInBounds(curpos)) { if (curpos.x < 0) curpos.x = 0; diff --git a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp index 8ebc239e8fc..7a1d8224d94 100644 --- a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp +++ b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp @@ -1214,8 +1214,8 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase { // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + - ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + + ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1234,8 +1234,8 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase { // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + - ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + + ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1252,7 +1252,7 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase { const Vec3 vj = v.getInterpolated(pts_sec[idx].pos); // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * vj); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * vj); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1474,8 +1474,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase { // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + - ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + + ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1515,8 +1515,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase { // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + - ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + + ct * (1 / Real(antitunneling)) * dt * v_sec[idx]); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1554,8 +1554,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase { // anti tunneling for small obstacles for (int ct = 1; ct < antitunneling; ct++) { - Vec3i tempPos = toVec3i(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * - (sumNumerator / sumDenominator)); + Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * + (sumNumerator / sumDenominator)); if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) { pts_sec.kill(idx); return; @@ -1863,7 +1863,7 @@ struct knFlipDeleteParticlesInObstacle : public KernelBase { return; const Vec3 &xi = pts[idx].pos; - const Vec3i xidx = toVec3i(xi); + const Vec3i xidx = toVec3iFloor(xi); // remove particles that completely left the bounds if (!flags.isInBounds(xidx)) { pts.kill(idx); diff --git a/extern/mantaflow/preprocessed/plugin/surfaceturbulence.cpp b/extern/mantaflow/preprocessed/plugin/surfaceturbulence.cpp index aa04b551e1e..e5aa09117ea 100644 --- a/extern/mantaflow/preprocessed/plugin/surfaceturbulence.cpp +++ b/extern/mantaflow/preprocessed/plugin/surfaceturbulence.cpp @@ -2145,8 +2145,7 @@ void PbRegister_particleSurfaceTurbulence() void debugCheckParts(const BasicParticleSystem &parts, const FlagGrid &flags) { for (int idx = 0; idx < parts.size(); idx++) { - Vec3i p = toVec3i(parts.getPos(idx)); - if (!flags.isInBounds(p)) { + if (!flags.isInBounds(parts.getPos(idx))) { debMsg("bad position??? " << idx << " " << parts.getPos(idx), 1); exit(1); } |