Additionally you can create the mesh in PhysX without serialization, which brings around 20% speed up and should be used for real time cooking.
In general the usage changes from:
- PxCooking::cookTriangleMesh(const PxTriangleMeshDesc& desc, PxOutputStream& stream
- PxPhysics::createTriangleMesh(PxInputStream& stream);
To:
createTriangleMesh(const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback)
Where insertion callback instance is retrieved from PxPhysics::getPhysicsInsertionCallback
Regards,
Ales