Public Member Functions | Protected Member Functions | List of all members
PxCooking Class Referenceabstract

#include <PxCooking.h>

Public Member Functions

virtual void release ()=0
 Closes this instance of the interface. More...
 
virtual void setParams (const PxCookingParams &params)=0
 Sets cooking parameters. More...
 
virtual const PxCookingParamsgetParams ()=0
 Gets cooking parameters. More...
 
virtual bool platformMismatch ()=0
 Checks endianness is the same between cooking & target platforms. More...
 
virtual bool cookTriangleMesh (const PxTriangleMeshDesc &desc, PxOutputStream &stream)=0
 Cooks a triangle mesh. The results are written to the stream. More...
 
virtual PxTriangleMeshcreateTriangleMesh (const PxTriangleMeshDesc &desc, PxPhysicsInsertionCallback &insertionCallback)=0
 Cooks and creates a triangle mesh and inserts it into PxPhysics. More...
 
virtual bool validateTriangleMesh (const PxTriangleMeshDesc &desc)=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)=0
 Cooks a convex mesh. The results are written to the stream. More...
 
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. More...
 
virtual bool cookHeightField (const PxHeightFieldDesc &desc, PxOutputStream &stream)=0
 Cooks a heightfield. The results are written to the stream. More...
 
virtual PxHeightFieldcreateHeightField (const PxHeightFieldDesc &desc, PxPhysicsInsertionCallback &insertionCallback)=0
 Cooks and creates a heightfield mesh and inserts it into PxPhysics. More...
 

Protected Member Functions

virtual ~PxCooking ()
 

Constructor & Destructor Documentation

virtual PxCooking::~PxCooking ( )
inlineprotectedvirtual

Member Function Documentation

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.

Parameters
[in]meshSimple triangle mesh containing vertices and triangles used to compute polygons.
[in]inCallbackMemory allocator for out array allocations.
[out]nbVertsNumber of vertices used by polygons.
[out]verticesVertices array used by polygons.
[out]nbIndicesNumber of indices used by polygons.
[out]indicesIndices array used by polygons.
[out]nbPolygonsNumber of created polygons.
[out]hullPolygonsPolygons array.
Returns
true on success
See Also
cookConvexMesh() PxConvexFlags PxConvexMeshDesc PxSimpleTriangleMesh
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
Note
The number of vertices and the number of convex polygons in a cooked convex mesh is limited to 256.
If those limits are exceeded in either the user-provided data or the final cooked mesh, an error is reported.
If the number of polygons exceed, using the PxConvexFlag::eINFLATE_CONVEX can help you to obtain a valid convex.
Parameters
[in]descThe convex mesh descriptor to read the mesh from.
[in]streamUser stream to output the cooked data.
[out]conditionResult from convex mesh cooking.
Returns
true on success
See Also
cookTriangleMesh() setParams() PxConvexMeshCookingResult::Enum
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.

Parameters
[in]descThe heightfield descriptor to read the HF from.
[in]streamUser stream to output the cooked data.
Returns
true on success
See Also
PxPhysics.createHeightField()
virtual bool PxCooking::cookTriangleMesh ( const PxTriangleMeshDesc desc,
PxOutputStream stream 
)
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
Parameters
[in]descThe triangle mesh descriptor to read the mesh from.
[in]streamUser stream to output the cooked data.
Returns
true on success
See Also
cookConvexMesh() setParams() PxPhysics.createTriangleMesh()
virtual PxHeightField* PxCooking::createHeightField ( const PxHeightFieldDesc desc,
PxPhysicsInsertionCallback insertionCallback 
)
pure virtual

Cooks and creates a heightfield mesh and inserts it into PxPhysics.

Parameters
[in]descThe heightfield descriptor to read the HF from.
[in]insertionCallbackThe insertion interface from PxPhysics.
Returns
PxHeightField pointer on success
See Also
cookConvexMesh() setParams() PxPhysics.createTriangleMesh() PxPhysicsInsertionCallback
virtual PxTriangleMesh* PxCooking::createTriangleMesh ( const PxTriangleMeshDesc desc,
PxPhysicsInsertionCallback insertionCallback 
)
pure virtual

Cooks and creates a triangle mesh and inserts it into PxPhysics.

Parameters
[in]descThe triangle mesh descriptor to read the mesh from.
[in]insertionCallbackThe insertion interface from PxPhysics.
Returns
PxTriangleMesh pointer on success
See Also
cookConvexMesh() setParams() PxPhysics.createTriangleMesh() PxPhysicsInsertionCallback
virtual const PxCookingParams& PxCooking::getParams ( )
pure virtual

Gets cooking parameters.

Returns
Current cooking parameters.
See Also
PxCookingParams setParams()
virtual bool PxCooking::platformMismatch ( )
pure virtual

Checks endianness is the same between cooking & target platforms.

Returns
True if there is and endian mismatch.
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.

Note
This function is required to be called to release foundation usage.
virtual void PxCooking::setParams ( const PxCookingParams params)
pure virtual

Sets cooking parameters.

Parameters
[in]paramsCooking parameters
See Also
getParams()
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.)
Parameters
[in]descThe triangle mesh descriptor to read the mesh from.
Returns
true if all the validity conditions hold, false otherwise.
See Also
cookTriangleMesh()

The documentation for this class was generated from the following file:


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com