From 7bceea80d4a04649f495f4f4331d7e3bdcdb05ca Mon Sep 17 00:00:00 2001 From: Marijn Tamis Date: Wed, 12 Sep 2018 14:12:47 +0200 Subject: 1.1.5 Release (24934621) --- NvCloth/src/ClothImpl.h | 15 ++++++++------- NvCloth/src/SwSolver.h | 2 +- NvCloth/src/SwSolverKernel.cpp | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'NvCloth/src') diff --git a/NvCloth/src/ClothImpl.h b/NvCloth/src/ClothImpl.h index 9bc4c36..dde7cdd 100644 --- a/NvCloth/src/ClothImpl.h +++ b/NvCloth/src/ClothImpl.h @@ -626,15 +626,16 @@ inline uint32_t ClothImpl::getNumSpheres() const template inline void ClothImpl::setCapsules(Range capsules, uint32_t first, uint32_t last) { + const IndexPair* srcIndices = reinterpret_cast(capsules.begin()); + const uint32_t srcIndicesSize = uint32_t(capsules.size() / 2); + uint32_t oldSize = uint32_t(getChildCloth()->mCapsuleIndices.size()); - uint32_t newSize = uint32_t(capsules.size() / 2) + oldSize - last + first; + uint32_t newSize = srcIndicesSize + oldSize - last + first; NV_CLOTH_ASSERT(newSize <= 32); NV_CLOTH_ASSERT(first <= oldSize); NV_CLOTH_ASSERT(last <= oldSize); - const IndexPair* srcIndices = reinterpret_cast(capsules.begin()); - if (getChildCloth()->mCapsuleIndices.capacity() < newSize) { ContextLockType contextLock(getChildCloth()->mFactory); @@ -660,8 +661,8 @@ inline void ClothImpl::setCapsules(Range capsules, uint32_t f } // fill existing elements from capsules - for (uint32_t i = first; i < last; ++i) - dstIndices[i] = srcIndices[i - first]; + for (uint32_t i = 0; i < srcIndicesSize; ++i) + dstIndices[first + i] = srcIndices[i]; getChildCloth()->wakeUp(); } @@ -1201,7 +1202,7 @@ inline physx::PxVec3 ClothImpl::getWindVelocity() const template inline void ClothImpl::setDragCoefficient(float coefficient) { - NV_CLOTH_ASSERT(coefficient < 1.f); + NV_CLOTH_ASSERT(coefficient <= 1.f); float value = safeLog2(1.f - coefficient); if (value == mDragLogCoefficient) @@ -1221,7 +1222,7 @@ inline float ClothImpl::getDragCoefficient() const template inline void ClothImpl::setLiftCoefficient(float coefficient) { - NV_CLOTH_ASSERT(coefficient < 1.f); + NV_CLOTH_ASSERT(coefficient <= 1.f); float value = safeLog2(1.f - coefficient); if (value == mLiftLogCoefficient) diff --git a/NvCloth/src/SwSolver.h b/NvCloth/src/SwSolver.h index ad58a7c..3aa1d92 100644 --- a/NvCloth/src/SwSolver.h +++ b/NvCloth/src/SwSolver.h @@ -61,7 +61,7 @@ class SwSolver : public Solver public: SwSolver(); - virtual ~SwSolver(); + virtual ~SwSolver() override; virtual void addCloth(Cloth*) override; virtual void addCloths(Range cloths) override; diff --git a/NvCloth/src/SwSolverKernel.cpp b/NvCloth/src/SwSolverKernel.cpp index ab612e2..782e758 100644 --- a/NvCloth/src/SwSolverKernel.cpp +++ b/NvCloth/src/SwSolverKernel.cpp @@ -458,9 +458,9 @@ void applyWind(T4f* __restrict curIt, const T4f* __restrict prevIt, const uint16 T4f impulse = (drag + lift) * fluidDensity * doubleArea & ~isZero; //fluidDensity compensates for double area - curIt[i0] = c0 - impulse * splat<3>(c0); - curIt[i1] = c1 - impulse * splat<3>(c1); - curIt[i2] = c2 - impulse * splat<3>(c2); + curIt[i0] = c0 - ((impulse * splat<3>(c0)) & sMaskXYZ); + curIt[i1] = c1 - ((impulse * splat<3>(c1)) & sMaskXYZ); + curIt[i2] = c2 - ((impulse * splat<3>(c2)) & sMaskXYZ); } } -- cgit v1.2.3