MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / createTriangleMesh

Method createTriangleMesh

physx/source/physxcooking/src/Cooking.cpp:142–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142PxTriangleMesh* 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
167PxTriangleMesh* Cooking::createTriangleMesh(const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback, PxTriangleMeshCookingResult::Enum* condition) const
168{

Callers

nothing calls this directly

Calls 6

checkMeshIndicesSizeMethod · 0.80
buildObjectFromDataMethod · 0.80
getMeshDataMethod · 0.80
loadFromDescMethod · 0.45
getMidphaseIDMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected