// ----------------------------------------------------------------------- MyCloth::~MyCloth() { if (mInitDone) { mScene->releaseCloth(*mCloth); mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh); releaseReceiveBuffers(); if (mTexCoords) free(mTexCoords); } }
// ----------------------------------------------------------------------- MyCloth::~MyCloth() { if (mInitDone) { if (mCloth) mScene->releaseCloth(*mCloth); if (mClothMesh) mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh); releaseReceiveBuffers(); free (mVertexRenderBuffer); free (mIndexRenderBuffer); } }
// ----------------------------------------------------------------------- MyCloth::~MyCloth() { if (mInitDone) { if (mCloth) mScene->releaseCloth(*mCloth); if (mClothMesh) mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh); releaseReceiveBuffers(); // temp texcoords are only used temporary and should be deallocated way earlier assert(mTempTexCoords == NULL); if (mTexId) { glDeleteTextures(1, &mTexId); mTexId = 0; } // delete the rendering buffers free (mVertexRenderBuffer); free (mIndexRenderBuffer); } }
PhysXCloth::~PhysXCloth() { if (mInitDone) { if (mCloth) mScene->releaseCloth(*mCloth); if (mClothMesh) mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh); releaseReceiveBuffers(); } mPositions.swap(std::vector<NxVec3>()); mNormals.swap(std::vector<NxVec3>()); mIndices.swap(std::vector<NxU32>()); if (mClothNode) { mClothNode->removeAndDestroyAllChildren(); mSceneMgr->destroySceneNode(mClothNode); } if (mManualObj) mSceneMgr->destroyManualObject(mManualObj); }