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/IterationState.h | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | archived-nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz archived-nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/src/IterationState.h')
| -rw-r--r-- | NvCloth/src/IterationState.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/NvCloth/src/IterationState.h b/NvCloth/src/IterationState.h index e18b636..be046b5 100644 --- a/NvCloth/src/IterationState.h +++ b/NvCloth/src/IterationState.h @@ -183,11 +183,15 @@ cloth::IterationStateFactory::IterationStateFactory(MyCloth& cloth, float frameD mPrevLinearVelocity = cloth.mLinearVelocity; mPrevAngularVelocity = cloth.mAngularVelocity; - // update cloth - float invFrameDt = 1.0f / frameDt; - cloth.mLinearVelocity = invFrameDt * (cloth.mTargetMotion.p - cloth.mCurrentMotion.p); - physx::PxQuat dq = cloth.mTargetMotion.q * cloth.mCurrentMotion.q.getConjugate(); - cloth.mAngularVelocity = log(dq) * invFrameDt; + if(!cloth.mIgnoreVelocityDiscontinuityNextFrame) + { + // update cloth + float invFrameDt = 1.0f / frameDt; + cloth.mLinearVelocity = invFrameDt * (cloth.mTargetMotion.p - cloth.mCurrentMotion.p); + physx::PxQuat dq = cloth.mTargetMotion.q * cloth.mCurrentMotion.q.getConjugate(); + cloth.mAngularVelocity = log(dq) * invFrameDt; + } + cloth.mIgnoreVelocityDiscontinuityNextFrame = false; cloth.mPrevIterDt = mIterDt; cloth.mIterDtAvg.push(static_cast<uint32_t>(mNumIterations), mIterDt); |