//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 92 | |
| 93 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 94 | bool Cooking::validateTriangleMesh(const PxTriangleMeshDesc& desc) const |
| 95 | { |
| 96 | // cooking code does lots of float bitwise reinterpretation that generates exceptions |
| 97 | PX_FPU_GUARD; |
| 98 | |
| 99 | if(!desc.isValid()) |
| 100 | { |
| 101 | Ps::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "Cooking::validateTriangleMesh: user-provided triangle mesh descriptor is invalid!"); |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | // PT: validation code doesn't look at midphase data, so ideally we wouldn't build the midphase structure at all here. |
| 106 | BV4TriangleMeshBuilder builder(mParams); |
| 107 | return builder.loadFromDesc(desc, NULL, true /*doValidate*/); |
| 108 | } |
| 109 | |
| 110 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 111 |
no test coverage detected