| 140 | } |
| 141 | |
| 142 | PxTriangleMesh* Cooking::createTriangleMesh(TriangleMeshBuilder& builder, const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback, PxTriangleMeshCookingResult::Enum* condition) const |
| 143 | { |
| 144 | // cooking code does lots of float bitwise reinterpretation that generates exceptions |
| 145 | PX_FPU_GUARD; |
| 146 | |
| 147 | if (condition) |
| 148 | *condition = PxTriangleMeshCookingResult::eSUCCESS; |
| 149 | if(!builder.loadFromDesc(desc, condition, false)) |
| 150 | { |
| 151 | return NULL; |
| 152 | } |
| 153 | |
| 154 | // check if the indices can be moved from 32bits to 16bits |
| 155 | if(!(mParams.meshPreprocessParams & PxMeshPreprocessingFlag::eFORCE_32BIT_INDICES)) |
| 156 | builder.checkMeshIndicesSize(); |
| 157 | |
| 158 | PxConcreteType::Enum type; |
| 159 | if(builder.getMidphaseID()==PxMeshMidPhase::eBVH33) |
| 160 | type = PxConcreteType::eTRIANGLE_MESH_BVH33; |
| 161 | else |
| 162 | type = PxConcreteType::eTRIANGLE_MESH_BVH34; |
| 163 | |
| 164 | return static_cast<PxTriangleMesh*>(insertionCallback.buildObjectFromData(type, &builder.getMeshData())); |
| 165 | } |
| 166 | |
| 167 | PxTriangleMesh* Cooking::createTriangleMesh(const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback, PxTriangleMeshCookingResult::Enum* condition) const |
| 168 | { |
nothing calls this directly
no test coverage detected