Esempio n. 1
0
// -----------------------------------------------------------------------
MyCloth::~MyCloth()
{
	if (mInitDone) {
		mScene->releaseCloth(*mCloth);
		mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh);
		releaseReceiveBuffers();
		if (mTexCoords) free(mTexCoords);
	}
}
Esempio n. 2
0
// -----------------------------------------------------------------------
MyCloth::~MyCloth()
{
	if (mInitDone) {
		if (mCloth) mScene->releaseCloth(*mCloth);
		if (mClothMesh) mScene->getPhysicsSDK().releaseClothMesh(*mClothMesh);
		releaseReceiveBuffers();
		free (mVertexRenderBuffer);
		free (mIndexRenderBuffer);
	}
}
Esempio n. 3
0
// -----------------------------------------------------------------------
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);
	}
}
Esempio n. 4
0
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);
}