We have the following code example:
PxConvexMeshDesc convexDesc;
convexDesc.points.count = 5;
convexDesc.points.stride = sizeof(PxVec3);
convexDesc.points.data = convexVerts;
convexDesc.flags = PxConvexFlag::eCOMPUTE_CONVEX | PxConvexFlag::eDISABLE_MESH_VALIDATION | PxConvexFlag::eFAST_INERTIA_COMPUTATION;
#ifdef _DEBUG
// mesh should be validated before cooking without the mesh cleaning
bool res = PxValidateConvexMesh(cookingParams, convexDesc);
PX_ASSERT(res);
#endif
PxConvexMesh* aConvexMesh = PxCreateConvexMesh(cookingParams, convexDesc,
thePhysics->getPhysicsInsertionCallback());
However it is not possible to validate a convex mesh consisting of only points, as the validation code requires polygon indices to present.
We have the following code example:
PxTolerancesScale scale;
PxCookingParams params(scale);
// disable mesh cleaning - perform mesh validation on development configurations
params.meshPreprocessParams |= PxMeshPreprocessingFlag::eDISABLE_CLEAN_MESH;
// disable edge precompute, edges are set for each triangle, slows contact generation
params.meshPreprocessParams |= PxMeshPreprocessingFlag::eDISABLE_ACTIVE_EDGES_PRECOMPUTE;
// lower hierarchy for internal mesh
params.meshCookingHint = PxMeshCookingHint::eCOOKING_PERFORMANCE;
PxTriangleMeshDesc meshDesc;
meshDesc.points.count = nbVerts;
meshDesc.points.stride = sizeof(PxVec3);
meshDesc.points.data = verts;
meshDesc.triangles.count = triCount;
meshDesc.triangles.stride = 3*sizeof(PxU32);
meshDesc.triangles.data = indices32;
#ifdef _DEBUG
// mesh should be validated before cooked without the mesh cleaning
bool res = PxValidateTriangleMesh(params, meshDesc);
PX_ASSERT(res);
#endif
PxTriangleMesh* aTriangleMesh = PxCreateTriangleMesh(params, meshDesc,
thePhysics->getPhysicsInsertionCallback());
However the PxCookingParams::meshCookingHint field no longer exists, nor does PxMeshCookingHint in general, as they were deprecated during PhysX 3 and subsequently removed.
Under Geometry - Convex Meshes
We have the following code example:
However it is not possible to validate a convex mesh consisting of only points, as the validation code requires polygon indices to present.
Under Geometry - Triangle Meshes
We have the following code example:
However the
PxCookingParams::meshCookingHintfield no longer exists, nor doesPxMeshCookingHintin general, as they were deprecated during PhysX 3 and subsequently removed.