PxComputeHullPolygons

Defined in include/cooking/PxCooking.h

bool PxComputeHullPolygons(const physx::PxCookingParams &params, const physx::PxSimpleTriangleMesh &mesh, physx::PxAllocatorCallback &inCallback, physx::PxU32 &nbVerts, physx::PxVec3 *&vertices, physx::PxU32 &nbIndices, physx::PxU32 *&indices, physx::PxU32 &nbPolygons, physx::PxHullPolygon *&hullPolygons)

Compute hull polygons from given vertices and triangles.

Polygons are needed for PxConvexMeshDesc rather than triangles.

Please note that the resulting polygons may have different number of vertices. Some vertices may be removed. The output vertices, indices and polygons must be used to construct a hull.

The provided PxAllocatorCallback does allocate the out arrays. It is the user responsibility to deallocated those arrays.

Parameters
  • params[in] The cooking parameters

  • mesh[in] Simple triangle mesh containing vertices and triangles used to compute polygons.

  • inCallback[in] Memory allocator for out array allocations.

  • nbVerts[out] Number of vertices used by polygons.

  • vertices[out] Vertices array used by polygons.

  • nbIndices[out] Number of indices used by polygons.

  • indices[out] Indices array used by polygons.

  • nbPolygons[out] Number of created polygons.

  • hullPolygons[out] Polygons array.

Returns

true on success