Closed Mubai64 closed 6 years ago
Hello,
Thanks for the bug report. We are probably not going to release another patch for 3.3.
I tried your code and found a trivial bug in Source/LowLevelCloth/src/ClothImpl.h in the function
inline void ClothImpl
Please try to replace the function with the one below. Thanks!
template
uint32_t oldSize = mCloth.mCapsuleIndices.size();
uint32_t newSize = srcIndicesSize + oldSize - last + first;
PX_ASSERT(newSize <= 32);
PX_ASSERT(first <= oldSize);
PX_ASSERT(last <= oldSize);
if(mCloth.mCapsuleIndices.capacity() < newSize)
{
ContextLockType contextLock(mCloth.mFactory);
mCloth.mCapsuleIndices.reserve(newSize);
}
// resize to larger of oldSize and newSize
mCloth.mCapsuleIndices.resize(PxMax(oldSize, newSize));
typename T::MappedIndexVectorType dstIndices = mCloth.mCapsuleIndices;
if(uint32_t delta = newSize-oldSize)
{
// move past-range elements to new place
move(dstIndices.begin(), last, oldSize, last + delta);
// fill new elements from capsules
for(uint32_t i=last; i<last+delta; ++i)
dstIndices[i] = srcIndices[i-first];
dstIndices.resize(newSize);
mCloth.notifyChanged();
}
// fill existing elements from capsules
for (uint32_t i=0; i < srcIndicesSize; ++i)
dstIndices[first + i] = srcIndices[i];
mCloth.wakeUp();
}
Hello, I'm using the PhysX-3.3 and the cloth1 is a PxCloth* Why dose the application crash at cloth1->removeCollisionCapsule( 1 ) (T_T)