#include <PxCooking.h>
Public Member Functions | |
virtual void | release ()=0 |
Closes this instance of the interface. More... | |
virtual void | setParams (const PxCookingParams ¶ms)=0 |
Sets cooking parameters. More... | |
virtual const PxCookingParams & | getParams () const =0 |
Gets cooking parameters. More... | |
virtual bool | platformMismatch () const =0 |
Checks endianness is the same between cooking & target platforms. More... | |
virtual bool | cookTriangleMesh (const PxTriangleMeshDesc &desc, PxOutputStream &stream, PxTriangleMeshCookingResult::Enum *condition=NULL) const =0 |
Cooks a triangle mesh. The results are written to the stream. More... | |
virtual PxTriangleMesh * | createTriangleMesh (const PxTriangleMeshDesc &desc, PxPhysicsInsertionCallback &insertionCallback, PxTriangleMeshCookingResult::Enum *condition=NULL) const =0 |
Cooks and creates a triangle mesh and inserts it into PxPhysics. More... | |
virtual bool | validateTriangleMesh (const PxTriangleMeshDesc &desc) const =0 |
Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found. More... | |
virtual bool | cookConvexMesh (const PxConvexMeshDesc &desc, PxOutputStream &stream, PxConvexMeshCookingResult::Enum *condition=NULL) const =0 |
Cooks a convex mesh. The results are written to the stream. More... | |
virtual PxConvexMesh * | createConvexMesh (const PxConvexMeshDesc &desc, PxPhysicsInsertionCallback &insertionCallback, PxConvexMeshCookingResult::Enum *condition=NULL) const =0 |
Cooks and creates a convex mesh and inserts it into PxPhysics. More... | |
virtual bool | validateConvexMesh (const PxConvexMeshDesc &desc) const =0 |
Verifies if the convex mesh is valid. Prints an error message for each inconsistency found. More... | |
virtual bool | computeHullPolygons (const PxSimpleTriangleMesh &mesh, PxAllocatorCallback &inCallback, PxU32 &nbVerts, PxVec3 *&vertices, PxU32 &nbIndices, PxU32 *&indices, PxU32 &nbPolygons, PxHullPolygon *&hullPolygons) const =0 |
Computed hull polygons from given vertices and triangles. Polygons are needed for PxConvexMeshDesc rather than triangles. More... | |
virtual bool | cookHeightField (const PxHeightFieldDesc &desc, PxOutputStream &stream) const =0 |
Cooks a heightfield. The results are written to the stream. More... | |
virtual PxHeightField * | createHeightField (const PxHeightFieldDesc &desc, PxPhysicsInsertionCallback &insertionCallback) const =0 |
Cooks and creates a heightfield mesh and inserts it into PxPhysics. More... | |
virtual bool | cookBVHStructure (const PxBVHStructureDesc &desc, PxOutputStream &stream) const =0 |
Cooks a bounding volume hierarchy structure. The results are written to the stream. More... | |
virtual PxBVHStructure * | createBVHStructure (const PxBVHStructureDesc &desc, PxPhysicsInsertionCallback &insertionCallback) const =0 |
Cooks and creates a bounding volume hierarchy structure and inserts it into PxPhysics. More... | |
Protected Member Functions | |
virtual | ~PxCooking () |
|
inlineprotectedvirtual |
|
pure virtual |
Computed 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 array's. It is the user responsibility to deallocated those array's.
[in] | mesh | Simple triangle mesh containing vertices and triangles used to compute polygons. |
[in] | inCallback | Memory allocator for out array allocations. |
[out] | nbVerts | Number of vertices used by polygons. |
[out] | vertices | Vertices array used by polygons. |
[out] | nbIndices | Number of indices used by polygons. |
[out] | indices | Indices array used by polygons. |
[out] | nbPolygons | Number of created polygons. |
[out] | hullPolygons | Polygons array. |
|
pure virtual |
Cooks a bounding volume hierarchy structure. The results are written to the stream.
cookBVHStructure() allows a BVH structure description to be cooked into a binary stream suitable for loading and performing BVH detection at runtime.
[in] | desc | The BVH structure descriptor. |
[in] | stream | User stream to output the cooked data. |
|
pure virtual |
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.
cookConvexMesh() allows a mesh description to be cooked into a binary stream suitable for loading and performing collision detection at runtime.
[in] | desc | The convex mesh descriptor to read the mesh from. |
[in] | stream | User stream to output the cooked data. |
[out] | condition | Result from convex mesh cooking. |
|
pure virtual |
Cooks a heightfield. The results are written to the stream.
To create a heightfield object there is an option to precompute some of calculations done while loading the heightfield data.
cookHeightField() allows a heightfield description to be cooked into a binary stream suitable for loading and performing collision detection at runtime.
[in] | desc | The heightfield descriptor to read the HF from. |
[in] | stream | User stream to output the cooked data. |
|
pure virtual |
Cooks a triangle 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.
cookTriangleMesh() allows a mesh description to be cooked into a binary stream suitable for loading and performing collision detection at runtime.
[in] | desc | The triangle mesh descriptor to read the mesh from. |
[in] | stream | User stream to output the cooked data. |
[out] | condition | Result from triangle mesh cooking. |
|
pure virtual |
Cooks and creates a bounding volume hierarchy structure and inserts it into PxPhysics.
[in] | desc | The BVH structure descriptor. |
[in] | insertionCallback | The insertion interface from PxPhysics. |
|
pure virtual |
Cooks and creates a convex mesh and inserts it into PxPhysics.
[in] | desc | The convex mesh descriptor to read the mesh from. |
[in] | insertionCallback | The insertion interface from PxPhysics. |
[out] | condition | Result from convex mesh cooking. |
|
pure virtual |
Cooks and creates a heightfield mesh and inserts it into PxPhysics.
[in] | desc | The heightfield descriptor to read the HF from. |
[in] | insertionCallback | The insertion interface from PxPhysics. |
|
pure virtual |
Cooks and creates a triangle mesh and inserts it into PxPhysics.
[in] | desc | The triangle mesh descriptor to read the mesh from. |
[in] | insertionCallback | The insertion interface from PxPhysics. |
[out] | condition | Result from triangle mesh cooking. |
|
pure virtual |
|
pure virtual |
Checks endianness is the same between cooking & target platforms.
|
pure virtual |
Closes this instance of the interface.
This function should be called to cleanly shut down the Cooking library before application exit.
|
pure virtual |
|
pure virtual |
Verifies if the convex mesh is valid. Prints an error message for each inconsistency found.
The convex mesh descriptor must contain an already created convex mesh - the vertices, indices and polygons must be provided.
[in] | desc | The convex mesh descriptor to read the mesh from. |
|
pure virtual |
Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found.
The following conditions are true for a valid triangle mesh: 1. There are no duplicate vertices (within specified vertexWeldTolerance. See PxCookingParams::meshWeldTolerance) 2. There are no large triangles (within specified PxTolerancesScale.)
[in] | desc | The triangle mesh descriptor to read the mesh from. |