#include <PxCooking.h>
++ +
Public Member Functions | |
| virtual void | release ()=0 |
| Closes this instance of the interface. | |
| virtual void | setParams (const PxCookingParams ¶ms)=0 |
| Sets cooking parameters. | |
| virtual const PxCookingParams & | getParams ()=0 |
| Gets cooking parameters. | |
| virtual bool | platformMismatch ()=0 |
| Checks endianness is the same between cooking & target platforms. | |
| virtual bool | cookTriangleMesh (const PxTriangleMeshDesc &desc, PxOutputStream &stream, PxTriangleMeshCookingResult::Enum *condition=NULL)=0 |
| Cooks a triangle mesh. The results are written to the stream. | |
| virtual PxTriangleMesh * | createTriangleMesh (const PxTriangleMeshDesc &desc, PxPhysicsInsertionCallback &insertionCallback)=0 |
| Cooks and creates a triangle mesh and inserts it into PxPhysics. | |
| virtual bool | validateTriangleMesh (const PxTriangleMeshDesc &desc)=0 |
| Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found. | |
| virtual bool | cookConvexMesh (const PxConvexMeshDesc &desc, PxOutputStream &stream, PxConvexMeshCookingResult::Enum *condition=NULL)=0 |
| Cooks a convex mesh. The results are written to the stream. | |
| virtual PxConvexMesh * | createConvexMesh (const PxConvexMeshDesc &desc, PxPhysicsInsertionCallback &insertionCallback)=0 |
| Cooks and creates a convex mesh and inserts it into PxPhysics. | |
| virtual bool | validateConvexMesh (const PxConvexMeshDesc &desc)=0 |
| Verifies if the convex mesh is valid. Prints an error message for each inconsistency found. | |
| virtual bool | computeHullPolygons (const PxSimpleTriangleMesh &mesh, PxAllocatorCallback &inCallback, PxU32 &nbVerts, PxVec3 *&vertices, PxU32 &nbIndices, PxU32 *&indices, PxU32 &nbPolygons, PxHullPolygon *&hullPolygons)=0 |
| Computed hull polygons from given vertices and triangles. Polygons are needed for PxConvexMeshDesc rather than triangles. | |
| virtual bool | cookHeightField (const PxHeightFieldDesc &desc, PxOutputStream &stream)=0 |
| Cooks a heightfield. The results are written to the stream. | |
| virtual PxHeightField * | createHeightField (const PxHeightFieldDesc &desc, PxPhysicsInsertionCallback &insertionCallback)=0 |
| Cooks and creates a heightfield mesh and inserts it into PxPhysics. | |
Protected Member Functions | |
| virtual | ~PxCooking () |
| virtual PxCooking::~PxCooking | +( | ++ | ) | + [inline, protected, virtual] |
+
+ +
+
| virtual bool PxCooking::computeHullPolygons | +( | +const PxSimpleTriangleMesh & | +mesh, | +|
| + | + | PxAllocatorCallback & | +inCallback, | +|
| + | + | PxU32 & | +nbVerts, | +|
| + | + | PxVec3 *& | +vertices, | +|
| + | + | PxU32 & | +nbIndices, | +|
| + | + | PxU32 *& | +indices, | +|
| + | + | PxU32 & | +nbPolygons, | +|
| + | + | PxHullPolygon *& | +hullPolygons | + |
| + | ) | + [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. |
| virtual bool PxCooking::cookConvexMesh | +( | +const PxConvexMeshDesc & | +desc, | +|
| + | + | PxOutputStream & | +stream, | +|
| + | + | PxConvexMeshCookingResult::Enum * | + condition = NULL | + |
| + | ) | + [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.
+Example
+
//TODO: Add Code Snippet Here
++
+If those limits are exceeded in either the user-provided data or the final cooked mesh, an error is reported.
| [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. |
| virtual bool PxCooking::cookHeightField | +( | +const PxHeightFieldDesc & | +desc, | +|
| + | + | PxOutputStream & | +stream | + |
| + | ) | + [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. |
| virtual bool PxCooking::cookTriangleMesh | +( | +const PxTriangleMeshDesc & | +desc, | +|
| + | + | PxOutputStream & | +stream, | +|
| + | + | PxTriangleMeshCookingResult::Enum * | + condition = NULL | + |
| + | ) | + [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.
+Example
+
//TODO: Add Code Snippet Here
++
| [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. |
| virtual PxConvexMesh* PxCooking::createConvexMesh | +( | +const PxConvexMeshDesc & | +desc, | +|
| + | + | PxPhysicsInsertionCallback & | +insertionCallback | + |
| + | ) | + [pure virtual] |
+
+Cooks and creates a convex mesh and inserts it into PxPhysics. +
+
+PxPhysicsInsertionCallback can be obtained through PxPhysics::getPhysicsInsertionCallback().
| [in] | desc | The convex mesh descriptor to read the mesh from. |
| [in] | insertionCallback | The insertion interface from PxPhysics. |
| virtual PxHeightField* PxCooking::createHeightField | +( | +const PxHeightFieldDesc & | +desc, | +|
| + | + | PxPhysicsInsertionCallback & | +insertionCallback | + |
| + | ) | + [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. |
| virtual PxTriangleMesh* PxCooking::createTriangleMesh | +( | +const PxTriangleMeshDesc & | +desc, | +|
| + | + | PxPhysicsInsertionCallback & | +insertionCallback | + |
| + | ) | + [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. |
| virtual const PxCookingParams& PxCooking::getParams | +( | ++ | ) | + [pure virtual] |
+
+Gets cooking parameters. +
+
| virtual bool PxCooking::platformMismatch | +( | ++ | ) | + [pure virtual] |
+
+Checks endianness is the same between cooking & target platforms. +
+
| virtual void PxCooking::release | +( | ++ | ) | + [pure virtual] |
+
+Closes this instance of the interface. +
+This function should be called to cleanly shut down the Cooking library before application exit.
+
| virtual void PxCooking::setParams | +( | +const PxCookingParams & | +params | +) | + [pure virtual] |
+
+Sets cooking parameters. +
+
| [in] | params | Cooking parameters |
| virtual bool PxCooking::validateConvexMesh | +( | +const PxConvexMeshDesc & | +desc | +) | + [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. |
| virtual bool PxCooking::validateTriangleMesh | +( | +const PxTriangleMeshDesc & | +desc | +) | + [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. |
+