PxCookConvexMesh

Defined in include/cooking/PxCooking.h

bool PxCookConvexMesh(const physx::PxCookingParams &params, const physx::PxConvexMeshDesc &desc, physx::PxOutputStream &stream, physx::PxConvexMeshCookingResult::Enum *condition = NULL)

Cooks a convex mesh.

The results are written to the stream.

To create a triangle mesh object it is necessary to first ‘cook’ the mesh data into a form which allows the SDK to perform efficient collision detection.

PxCookConvexMesh() allows a mesh description to be cooked into a binary stream suitable for loading and performing collision detection at runtime.

See also

PxCookTriangleMesh() PxConvexMeshCookingResult::Enum

Note

The number of vertices and the number of convex polygons in a cooked convex mesh is limited to 255.

Note

If those limits are exceeded in either the user-provided data or the final cooked mesh, an error is reported.

Parameters
  • params[in] The cooking parameters

  • desc[in] The convex mesh descriptor to read the mesh from.

  • stream[in] User stream to output the cooked data.

  • condition[out] Result from convex mesh cooking.

Returns

true on success.