34#include "common/PxPhysXCommonConfig.h"
35#include "common/PxTolerancesScale.h"
36#include "cooking/Pxc.h"
38#include "cooking/PxConvexMeshDesc.h"
39#include "cooking/PxTriangleMeshDesc.h"
40#include "cooking/PxTetrahedronMeshDesc.h"
41#include "cooking/PxMidphaseDesc.h"
42#include "cooking/PxBVHDesc.h"
43#include "geometry/PxTriangleMesh.h"
44#include "geometry/PxTetrahedronMesh.h"
45#include "geometry/PxBVH.h"
52class PxInsertionCallback;
54class PxAllocatorCallback;
55class PxHeightFieldDesc;
177typedef PxFlags<PxMeshPreprocessingFlag::Enum,PxU32> PxMeshPreprocessingFlags;
735 PxU32& nbIndices, PxU32*& indices, PxU32& nbPolygons,
PxHullPolygon*& hullPolygons)
const = 0;
803 return cookBVH(desc, stream);
852 return createBVH(desc, insertionCallback);
907 return PxCreateBVH(desc, *PxGetStandaloneInsertionCallback());
916 return PxCreateHeightField(desc, *PxGetStandaloneInsertionCallback());
925 return PxCreateConvexMesh(params, desc, *PxGetStandaloneInsertionCallback());
930 physx::PxU32& nbIndices, physx::PxU32*& indices, physx::PxU32& nbPolygons,
physx::PxHullPolygon*& hullPolygons);
939 return PxCreateTriangleMesh(params, desc, *PxGetStandaloneInsertionCallback());
948 return PxCreateTetrahedronMesh(params, meshDesc, *PxGetStandaloneInsertionCallback());
960 return PxCreateSoftBodyMesh(params, simulationMeshDesc, collisionMeshDesc, softbodyDataDesc, *PxGetStandaloneInsertionCallback());
Abstract base class for an application defined memory allocator that can be used by the Nv library.
Definition PxAllocatorCallback.h:53
Descriptor class for #PxBVH.
Definition PxBVHDesc.h:51
Class representing a bounding volume hierarchy.
Definition PxBVH.h:63
Contains information about how to update the collision mesh's vertices given a deformed simulation te...
Definition PxTetrahedronMesh.h:283
Conbines PxTetrahedronMeshData and PxSoftBodyCollisionData.
Definition PxTetrahedronMesh.h:330
Descriptor class for #PxConvexMesh.
Definition PxConvexMeshDesc.h:156
A convex mesh.
Definition PxConvexMesh.h:83
Provides methods to cook (where cooking means to prepare the data and convert it to the right format ...
Definition PxCooking.h:337
virtual bool cookBVH(const PxBVHDesc &desc, PxOutputStream &stream) const =0
Cooks a bounding volume hierarchy. The results are written to the stream.
PX_FORCE_INLINE PxConvexMesh * createConvexMesh(const PxConvexMeshDesc &desc) const
Cooks and creates a convex mesh without going through a stream. Convenience function for standalone o...
Definition PxCooking.h:693
virtual bool cookTetrahedronMesh(const PxTetrahedronMeshDesc &meshDesc, PxOutputStream &stream) const =0
Cooks a tetrahedron mesh. The results are written to the stream.
virtual PxInsertionCallback & getStandaloneInsertionCallback()=0
Gets standalone object insertion interface.
virtual PxSoftBodyMesh * createSoftBodyMesh(const PxTetrahedronMeshDesc &simulationMeshDesc, const PxTetrahedronMeshDesc &collisionMeshDesc, const PxSoftBodySimulationDataDesc &softbodyDataDesc, PxInsertionCallback &insertionCallback) const =0
Cooks and creates a softbody mesh without going through a stream.
PX_DEPRECATED PX_FORCE_INLINE PxBVHStructure * createBVHStructure(const PxBVHStructureDesc &desc, PxInsertionCallback &insertionCallback) const
Backward compatibility helper. Cooks and creates a bounding volume hierarchy without going through a ...
Definition PxCooking.h:850
virtual PxSoftBodyMesh * assembleSoftBodyMesh(PxSimulationTetrahedronMeshData &simulationMesh, PxCollisionTetrahedronMeshData &collisionMesh, PxCollisionMeshMappingData &mappingData, PxInsertionCallback &insertionCallback) const =0
Bundles all data required for softbody simulation.
virtual void setParams(const PxCookingParams ¶ms)=0
Sets cooking parameters.
virtual PxSimulationTetrahedronMeshData * computeSimulationData(const PxTetrahedronMeshDesc &simulationMeshDesc) const =0
Computes data to accelerate collision detection of tetrahedral meshes.
virtual PxSoftBodyMesh * assembleSoftBodyMesh(PxTetrahedronMeshData &simulationMesh, PxSoftBodySimulationData &simulationData, PxTetrahedronMeshData &collisionMesh, PxSoftBodyCollisionData &collisionData, PxCollisionMeshMappingData &mappingData, PxInsertionCallback &insertionCallback) const =0
Bundles all data required for softbody simulation.
PX_FORCE_INLINE PxSoftBodyMesh * createSoftBodyMesh(const PxTetrahedronMeshDesc &simulationMeshDesc, const PxTetrahedronMeshDesc &collisionMeshDesc, const PxSoftBodySimulationDataDesc &softbodyDataDesc) const
Cooks and creates a softbody mesh without going through a stream. Convenience function for standalone...
Definition PxCooking.h:502
virtual bool cookHeightField(const PxHeightFieldDesc &desc, PxOutputStream &stream) const =0
Cooks a heightfield. The results are written to the stream.
virtual bool platformMismatch() const =0
Checks endianness is the same between cooking & target platforms.
PX_FORCE_INLINE PxTriangleMesh * createTriangleMesh(const PxTriangleMeshDesc &desc) const
Cooks and creates a triangle mesh without going through a stream. Convenience function for standalone...
Definition PxCooking.h:423
virtual bool validateConvexMesh(const PxConvexMeshDesc &desc) const =0
Verifies if the convex mesh is valid. Prints an error message for each inconsistency found.
virtual PxConvexMesh * createConvexMesh(const PxConvexMeshDesc &desc, PxInsertionCallback &insertionCallback, PxConvexMeshCookingResult::Enum *condition=NULL) const =0
Cooks and creates a convex mesh without going through a stream.
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.
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 ra...
PX_FORCE_INLINE PxHeightField * createHeightField(const PxHeightFieldDesc &desc) const
Cooks and creates a heightfield mesh and inserts it into PxPhysics. Convenience function for standalo...
Definition PxCooking.h:773
virtual PxHeightField * createHeightField(const PxHeightFieldDesc &desc, PxInsertionCallback &insertionCallback) const =0
Cooks and creates a heightfield mesh and inserts it into PxPhysics.
virtual PxBVH * createBVH(const PxBVHDesc &desc, PxInsertionCallback &insertionCallback) const =0
Cooks and creates a bounding volume hierarchy without going through a stream.
virtual const PxCookingParams & getParams() const =0
Gets cooking parameters.
virtual bool validateTriangleMesh(const PxTriangleMeshDesc &desc) const =0
Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found.
virtual PxCollisionTetrahedronMeshData * computeCollisionData(const PxTetrahedronMeshDesc &collisionMeshDesc) const =0
Computes data to accelerate collision detection of tetrahedral meshes.
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.
PX_DEPRECATED PX_FORCE_INLINE bool cookBVHStructure(const PxBVHStructureDesc &desc, PxOutputStream &stream) const
Backward compatibility helper. Cooks a bounding volume hierarchy. The results are written to the stre...
Definition PxCooking.h:801
PX_FORCE_INLINE PxBVH * createBVH(const PxBVHDesc &desc) const
Cooks and creates a bounding volume hierarchy without going through a stream. Convenience function fo...
Definition PxCooking.h:837
virtual PxTetrahedronMesh * createTetrahedronMesh(const PxTetrahedronMeshDesc &meshDesc, PxInsertionCallback &insertionCallback) const =0
Cooks and creates a tetrahedron mesh without going through a stream.
virtual void release()=0
Closes this instance of the interface.
PX_FORCE_INLINE PxTetrahedronMesh * createTetrahedronMesh(const PxTetrahedronMeshDesc &meshDesc) const
Cooks and creates a tetrahedron mesh without going through a stream. Convenience function for standal...
Definition PxCooking.h:558
virtual PxTriangleMesh * createTriangleMesh(const PxTriangleMeshDesc &desc, PxInsertionCallback &insertionCallback, PxTriangleMeshCookingResult::Enum *condition=NULL) const =0
Cooks and creates a triangle mesh without going through a stream.
virtual bool cookSoftBodyMesh(const PxTetrahedronMeshDesc &simulationMeshDesc, const PxTetrahedronMeshDesc &collisionMeshDesc, const PxSoftBodySimulationDataDesc &softbodyDataDesc, PxOutputStream &stream) const =0
Cooks a softbody mesh. The results are written to the stream.
virtual PxCollisionMeshMappingData * computeModelsMapping(PxTetrahedronMeshData &simulationMesh, const PxTetrahedronMeshData &collisionMesh, const PxSoftBodyCollisionData &collisionData, const PxBoundedData *vertexToTet=NULL) const =0
Computes the mapping between collision and simulation mesh.
Foundation SDK singleton class.
Definition PxFoundation.h:57
Descriptor class for #PxHeightField.
Definition PxHeightFieldDesc.h:53
A height field class.
Definition PxHeightField.h:84
Callback interface that permits TriangleMesh, Heightfield, ConvexMesh or BVH to be used directly with...
Definition PxInsertionCallback.h:57
Structure describing parameters affecting midphase mesh structure.
Definition PxMidphaseDesc.h:51
Output stream class for I/O.
Definition PxIO.h:114
A structure describing a triangle mesh.
Definition PxSimpleTriangleMesh.h:83
Conbines PxTetrahedronMeshData and PxSoftBodyCollisionData.
Definition PxTetrahedronMesh.h:348
Stores data to accelerate collision detection of a tetrahedral mesh.
Definition PxTetrahedronMesh.h:297
A softbody mesh, containing structures to store collision shape, simulation shape and deformation sta...
Definition PxTetrahedronMesh.h:214
**
Definition PxTetrahedronMeshDesc.h:194
Stores data to compute and store the state of a deformed tetrahedral mesh.
Definition PxTetrahedronMesh.h:319
Contains raw geometry information describing the tetmesh's vertices and its elements (tetrahedra)
Definition PxTetrahedronMesh.h:308
Descriptor class for #PxTetrahedronMesh (contains only pure geometric data).
Definition PxTetrahedronMeshDesc.h:52
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
Class to define the scale at which simulation runs. Most simulation tolerances are calculated in term...
Definition PxTolerancesScale.h:53
Descriptor class for #PxTriangleMesh.
Definition PxTriangleMeshDesc.h:55
A triangle mesh, also called a 'polygon soup'.
Definition PxTriangleMesh.h:118
3 Element vector class.
Definition PxVec3.h:50
PX_C_EXPORT PX_PHYSX_COOKING_API PX_DEPRECATED physx::PxCooking *PX_CALL_CONV PxCreateCooking(physx::PxU32 version, physx::PxFoundation &foundation, const physx::PxCookingParams ¶ms)
Create an instance of the cooking interface.
Definition Cooking.cpp:194
#define PX_CALL_CONV
Definition PxPreprocessor.h:299
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_DEPRECATED PxBVHDesc PxBVHStructureDesc
Definition PxBVHDesc.h:137
PX_DEPRECATED PxBVH PxBVHStructure
Definition PxPhysics.h:73
Definition PxCoreUtilityTypes.h:96
Result from convex cooking.
Definition PxCooking.h:61
Enum
Definition PxCooking.h:63
@ ePOLYGONS_LIMIT_REACHED
Convex mesh cooking succeeded, but the algorithm has reached the 255 polygons limit....
Definition PxCooking.h:83
@ eSUCCESS
Convex mesh cooking succeeded.
Definition PxCooking.h:67
@ eFAILURE
Something unrecoverable happened. Check the error stream to find out what.
Definition PxCooking.h:88
@ eZERO_AREA_TEST_FAILED
Convex mesh cooking failed, algorithm couldn't find 4 initial vertices without a small triangle.
Definition PxCooking.h:74
Enumeration for convex mesh cooking algorithms.
Definition PxCooking.h:94
Enum
Definition PxCooking.h:96
@ eQUICKHULL
The Quickhull algorithm constructs the hull from the given input points. The resulting hull will only...
Definition PxCooking.h:102
Structure describing parameters affecting mesh cooking.
Definition PxCooking.h:185
bool suppressTriangleMeshRemapTable
When true, the face remap table is not created. This saves a significant amount of memory,...
Definition PxCooking.h:238
PxReal maxWeightRatioInTet
Maximum mass ratio allowed on vertices touched by a single tet. If a any tetrahedron exceeds the mass...
Definition PxCooking.h:313
float areaTestEpsilon
Zero-size area epsilon used in convex hull computation.
Definition PxCooking.h:198
PxConvexMeshCookingType::Enum convexMeshCookingType
Convex hull creation algorithm.
Definition PxCooking.h:229
PxMidphaseDesc midphaseDesc
Controls the desired midphase desc structure for triangle meshes.
Definition PxCooking.h:295
bool buildTriangleAdjacencies
When true, the triangle adjacency information is created. You can get the adjacency triangles for a g...
Definition PxCooking.h:246
PxMeshPreprocessingFlags meshPreprocessParams
Mesh pre-processing parameters. Used to control options like whether the mesh cooking performs vertex...
Definition PxCooking.h:269
bool buildGPUData
When true, addigional information required for GPU-accelerated rigid body simulation is created....
Definition PxCooking.h:253
PxU32 gaussMapLimit
Vertex limit beyond which additional acceleration structures are computed for each convex mesh....
Definition PxCooking.h:304
float planeTolerance
Plane tolerance used in convex hull computation.
Definition PxCooking.h:220
PxTolerancesScale scale
Tolerance scale is used to check if cooked triangles are not too huge. This check will help with simu...
Definition PxCooking.h:262
PxReal meshWeldTolerance
Mesh weld tolerance. If mesh welding is enabled, this controls the distance at which vertices are wel...
Definition PxCooking.h:286
Polygon data.
Definition PxConvexMesh.h:50
Enum for the set of mesh pre-processing parameters.
Definition PxCooking.h:134
Enum
Definition PxCooking.h:136
@ eFORCE_32BIT_INDICES
When set, 32-bit indices will always be created regardless of triangle count.
Definition PxCooking.h:162
@ eENABLE_INERTIA
When set, inertia tensor is calculated for the mesh.
Definition PxCooking.h:172
@ eDISABLE_ACTIVE_EDGES_PRECOMPUTE
When set, active edges are set for each triangle edge. This makes cooking faster but slow up contact ...
Definition PxCooking.h:155
@ eDISABLE_CLEAN_MESH
When set, mesh cleaning is disabled. This makes cooking faster.
Definition PxCooking.h:150
@ eWELD_VERTICES
When set, mesh welding is performed. See PxCookingParams::meshWeldTolerance. Clean mesh must be enabl...
Definition PxCooking.h:140
@ eENABLE_VERT_MAPPING
When set, a list of triangles will be created for each associated vertex in the mesh.
Definition PxCooking.h:167
Result from triangle mesh cooking.
Definition PxCooking.h:110
Enum
Definition PxCooking.h:112
@ eLARGE_TRIANGLE
a triangle is too large for well-conditioned results. Tessellate the mesh for better behavior,...
Definition PxCooking.h:121
@ eFAILURE
Something unrecoverable happened. Check the error stream to find out what.
Definition PxCooking.h:126
@ eSUCCESS
Everything is A-OK.
Definition PxCooking.h:116