Defined in include/collision/PxCollisionDefs.h

class PxCacheAllocator

A callback class to allocate memory to cache information used in contact generation.

Public Functions

virtual PxU8 *allocateCacheData(const PxU32 byteSize) = 0

Allocates cache data for contact generation.

This data is stored inside PxCache objects. The application can retain and provide this information for future contact generation passes for a given pair to improve contact generation performance. It is the application’s responsibility to release this memory appropriately. If the memory is released, the application must ensure that this memory is no longer referenced by any PxCache objects passed to PxGenerateContacts.


byteSize – [in] size of the allocation in bytes


the newly-allocated memory. The returned address must be 16-byte aligned.

inline virtual ~PxCacheAllocator()