diff options
| author | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
| commit | ca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch) | |
| tree | b06b9eec03f34344ef8fc31aa147b2714d3962ee /NvCloth/src/SwSolverKernel.cpp | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/src/SwSolverKernel.cpp')
| -rw-r--r-- | NvCloth/src/SwSolverKernel.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/NvCloth/src/SwSolverKernel.cpp b/NvCloth/src/SwSolverKernel.cpp index 2181b1e..ab612e2 100644 --- a/NvCloth/src/SwSolverKernel.cpp +++ b/NvCloth/src/SwSolverKernel.cpp @@ -276,6 +276,8 @@ void constrainSeparation(T4f* __restrict curIt, const T4f* __restrict curEnd, co } } + + /** traditional gauss-seidel internal constraint solver */ @@ -350,7 +352,7 @@ void solveConstraints(float* __restrict posIt, const float* __restrict rIt, cons erij = erij - multiplier * max(compressionLimit, min(erij, stretchLimit)); } - //ex = er * stiffness / sqrt(epsilon + vw) + //ex = er * stiffness / (epsilon + inMass sum) T4f exij = erij * stij * recip(gSimd4fEpsilon + vwij); //h = h * ex @@ -375,7 +377,7 @@ void solveConstraints(float* __restrict posIt, const float* __restrict rIt, cons #include "sse2/SwSolveConstraints.h" #endif -// calculates upper bound of all position deltas +// Calculates upper bound of all position deltas template <typename T4f> T4f calculateMaxDelta(const T4f* prevIt, const T4f* curIt, const T4f* curEnd) { @@ -391,6 +393,11 @@ void applyWind(T4f* __restrict curIt, const T4f* __restrict prevIt, const uint16 const uint16_t* __restrict tEnd, float itrDtf, float dragCoefficientf, float liftCoefficientf, float fluidDensityf, T4f wind, const T4f (&rotation)[3]) { + // Note: Enabling wind can amplify bad behavior since the impulse scales with area, + // and the area of triangles increases when constraints are violated. + // Using the initial triangle area based on the rest length is one possible way to + // prevent this, but is expensive (and incorrect for intentionally stretchy cloth). + const T4f dragCoefficient = simd4f(dragCoefficientf); const T4f liftCoefficient = simd4f(liftCoefficientf); const T4f fluidDensity = simd4f(fluidDensityf); |