Crash in cookTriangleMesh

Hi guys,

I am having a weird problem when I build a cook triangle mesh. It seems that it is crashing when the number of triangles are big. It only happens in debug (CHECKED), not in release libs, the really strange point is that if I got the remote debugger enabled the crash doesn’t happen.

Any idea about what could be causing this strange issue?

PD: The version I am using is 3.3.0 , and this is the code I am using to create the triangle mesh, and the mesh seems to be created properly on the remote debugger.

physx::PxTriangleMeshDesc triangleMeshDesc;
	triangleMeshDesc.points.count = static_cast<physx::PxU32> (numVertices);
	triangleMeshDesc.points.stride = sizeof(float) * 3; = tempVertices;

	triangleMeshDesc.triangles.count = static_cast<physx::PxU32> (numTriangles);
	triangleMeshDesc.triangles.stride = 3 * sizeof(uint32); = indices;

	if (triangleMeshDesc.isValid())
		Ogre::LogManager::getSingletonPtr()->logMessage("trianglemeshdesc OK!");
		MemoryWriteBuffer buf;
		if(bool results = mCooking->cookTriangleMesh(triangleMeshDesc, buf))
			Ogre::LogManager::getSingletonPtr()->logMessage("nxcooking results: " + Ogre::StringConverter::toString(results));
			MemoryReadBuffer readBuffer(;
			triMesh = mPhysicsSDK->createTriangleMesh(readBuffer);
		Ogre::LogManager::getSingletonPtr()->logMessage( "trianglemeshdesc invalid!!!" );
	delete []tempVertices;
	return triMesh;

Ok, after a few checks I have realized that it is not a problem of PhysX at all.

Sorry :)