| 43 | /////////////////////////////////////////////////////////////////////////////// |
| 44 | |
| 45 | PxTriangleMesh* PxToolkit::createTriangleMesh32(PxPhysics& physics, PxCooking& cooking, const PxVec3* verts, PxU32 vertCount, const PxU32* indices32, PxU32 triCount, bool insert) |
| 46 | { |
| 47 | PxTriangleMeshDesc meshDesc; |
| 48 | meshDesc.points.count = vertCount; |
| 49 | meshDesc.points.stride = sizeof(PxVec3); |
| 50 | meshDesc.points.data = verts; |
| 51 | |
| 52 | meshDesc.triangles.count = triCount; |
| 53 | meshDesc.triangles.stride = 3*sizeof(PxU32); |
| 54 | meshDesc.triangles.data = indices32; |
| 55 | |
| 56 | if(!insert) |
| 57 | { |
| 58 | PxDefaultMemoryOutputStream writeBuffer; |
| 59 | bool status = cooking.cookTriangleMesh(meshDesc, writeBuffer); |
| 60 | if(!status) |
| 61 | return NULL; |
| 62 | |
| 63 | PxDefaultMemoryInputData readBuffer(writeBuffer.getData(), writeBuffer.getSize()); |
| 64 | return physics.createTriangleMesh(readBuffer); |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | return cooking.createTriangleMesh(meshDesc,physics.getPhysicsInsertionCallback()); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | PxTriangleMesh* PxToolkit::createTriangleMesh32(PxPhysics& physics, PxCooking& cooking, PxTriangleMeshDesc* meshDesc, bool insert) |
| 73 | { |
nothing calls this directly
no test coverage detected