45#include "cooking/PxCooking.h"
47#include "common/PxPhysXCommonConfig.h"
48#include "foundation/PxUtilities.h"
49#include "foundation/PxMemory.h"
53 class PxInsertionCallback;
58 struct PxCookingParams;
60 namespace immediateCooking
62 PX_FORCE_INLINE static void gatherStrided(
const void* src,
void* dst, PxU32 nbElem, PxU32 elemSize, PxU32 stride)
64 const PxU8* s =
reinterpret_cast<const PxU8*
>(src);
65 PxU8* d =
reinterpret_cast<PxU8*
>(dst);
77 const PxI8 currentEndian = PxLittleEndian();
79 const bool mismatch = currentEndian!=1;
83 PX_C_EXPORT PX_PHYSX_COMMON_API PxInsertionCallback* getInsertionCallback();
86 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookBVH(
const PxBVHDesc& desc, PxOutputStream& stream);
87 PX_C_EXPORT PX_PHYSX_COMMON_API PxBVH* createBVH(
const PxBVHDesc& desc, PxInsertionCallback& insertionCallback);
91 return createBVH(desc, *getInsertionCallback());
95 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookHeightField(
const PxHeightFieldDesc& desc, PxOutputStream& stream);
96 PX_C_EXPORT PX_PHYSX_COMMON_API PxHeightField* createHeightField(
const PxHeightFieldDesc& desc, PxInsertionCallback& insertionCallback);
98 PX_FORCE_INLINE PxHeightField* createHeightField(
const PxHeightFieldDesc& desc)
100 return createHeightField(desc, *getInsertionCallback());
104 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookConvexMesh(
const PxCookingParams& params,
const PxConvexMeshDesc& desc, PxOutputStream& stream,
PxConvexMeshCookingResult::Enum* condition=NULL);
105 PX_C_EXPORT PX_PHYSX_COMMON_API PxConvexMesh* createConvexMesh(
const PxCookingParams& params,
const PxConvexMeshDesc& desc, PxInsertionCallback& insertionCallback,
PxConvexMeshCookingResult::Enum* condition=NULL);
107 PX_FORCE_INLINE PxConvexMesh* createConvexMesh(
const PxCookingParams& params,
const PxConvexMeshDesc& desc)
109 return createConvexMesh(params, desc, *getInsertionCallback());
112 PX_C_EXPORT PX_PHYSX_COMMON_API
bool validateConvexMesh(
const PxCookingParams& params,
const PxConvexMeshDesc& desc);
113 PX_C_EXPORT PX_PHYSX_COMMON_API
bool computeHullPolygons(
const PxCookingParams& params,
const PxSimpleTriangleMesh& mesh, PxAllocatorCallback& inCallback, PxU32& nbVerts, PxVec3*& vertices,
114 PxU32& nbIndices, PxU32*& indices, PxU32& nbPolygons, PxHullPolygon*& hullPolygons);
117 PX_C_EXPORT PX_PHYSX_COMMON_API
bool validateTriangleMesh(
const PxCookingParams& params,
const PxTriangleMeshDesc& desc);
118 PX_C_EXPORT PX_PHYSX_COMMON_API PxTriangleMesh* createTriangleMesh(
const PxCookingParams& params,
const PxTriangleMeshDesc& desc, PxInsertionCallback& insertionCallback,
PxTriangleMeshCookingResult::Enum* condition=NULL);
119 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookTriangleMesh(
const PxCookingParams& params,
const PxTriangleMeshDesc& desc, PxOutputStream& stream,
PxTriangleMeshCookingResult::Enum* condition=NULL);
121 PX_FORCE_INLINE PxTriangleMesh* createTriangleMesh(
const PxCookingParams& params,
const PxTriangleMeshDesc& desc)
123 return createTriangleMesh(params, desc, *getInsertionCallback());
127 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookTetrahedronMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& meshDesc, PxOutputStream& stream);
128 PX_C_EXPORT PX_PHYSX_COMMON_API PxTetrahedronMesh* createTetrahedronMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& meshDesc, PxInsertionCallback& insertionCallback);
130 PX_FORCE_INLINE PxTetrahedronMesh* createTetrahedronMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& meshDesc)
132 return createTetrahedronMesh(params, meshDesc, *getInsertionCallback());
135 PX_C_EXPORT PX_PHYSX_COMMON_API
bool cookSoftBodyMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& simulationMeshDesc,
const PxTetrahedronMeshDesc& collisionMeshDesc,
136 const PxSoftBodySimulationDataDesc& softbodyDataDesc, PxOutputStream& stream);
138 PX_C_EXPORT PX_PHYSX_COMMON_API PxSoftBodyMesh* createSoftBodyMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& simulationMeshDesc,
const PxTetrahedronMeshDesc& collisionMeshDesc,
139 const PxSoftBodySimulationDataDesc& softbodyDataDesc, PxInsertionCallback& insertionCallback);
141 PX_FORCE_INLINE PxSoftBodyMesh* createSoftBodyMesh(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& simulationMeshDesc,
const PxTetrahedronMeshDesc& collisionMeshDesc,
142 const PxSoftBodySimulationDataDesc& softbodyDataDesc)
144 return createSoftBodyMesh(params, simulationMeshDesc, collisionMeshDesc, softbodyDataDesc, *getInsertionCallback());
147 PX_C_EXPORT PX_PHYSX_COMMON_API PxCollisionMeshMappingData* computeModelsMapping(
const PxCookingParams& params, PxTetrahedronMeshData& simulationMesh,
const PxTetrahedronMeshData& collisionMesh,
148 const PxSoftBodyCollisionData& collisionData,
const PxBoundedData* vertexToTet = NULL);
150 PX_C_EXPORT PX_PHYSX_COMMON_API PxCollisionTetrahedronMeshData* computeCollisionData(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& collisionMeshDesc);
152 PX_C_EXPORT PX_PHYSX_COMMON_API PxSimulationTetrahedronMeshData* computeSimulationData(
const PxCookingParams& params,
const PxTetrahedronMeshDesc& simulationMeshDesc);
154 PX_C_EXPORT PX_PHYSX_COMMON_API PxSoftBodyMesh* assembleSoftBodyMesh(PxTetrahedronMeshData& simulationMesh, PxSoftBodySimulationData& simulationData, PxTetrahedronMeshData& collisionMesh,
155 PxSoftBodyCollisionData& collisionData, PxCollisionMeshMappingData& mappingData, PxInsertionCallback& insertionCallback);
157 PX_C_EXPORT PX_PHYSX_COMMON_API PxSoftBodyMesh* assembleSoftBodyMesh_Sim(PxSimulationTetrahedronMeshData& simulationMesh, PxCollisionTetrahedronMeshData& collisionMesh,
158 PxCollisionMeshMappingData& mappingData, PxInsertionCallback& insertionCallback);
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_FORCE_INLINE void * PxMemCopy(void *dest, const void *src, PxU32 count)
Copies the bytes of one memory block to another. The memory blocks must not overlap.
Definition PxMemory.h:83
Enum
Definition PxCooking.h:63
Enum
Definition PxCooking.h:112