PxReportCallback

Defined in include/geometry/PxReportCallback.h

template<class T>
class PxReportCallback

Base class for callback reporting an unknown number of items to users.

This can be used as-is and customized by users, or several pre-designed callbacks can be used instead (see below).

This design lets users decide how to retrieve the results of a query:

  • either one by one via a regular callback

  • or one batch at a time via a callback

  • or written out directly to their own C-style buffer

  • or pushed back to their own PxArray

  • etc

Subclassed by PxDynamicArrayReportCallback< T >, PxExternalStorageReportCallback< T >, PxLocalStorageReportCallback< T, capacityT >, PxRegularReportCallback< T >

Public Functions

inline PxReportCallback(T *buffer = NULL, PxU32 capacity = 0)
inline virtual ~PxReportCallback()
virtual bool flushResults(PxU32 nbItems, const T *items) = 0

Reports query results to users.

This will be called by the system as many times as necessary to report all results.

Parameters
  • nbItems[in] Number of reported items

  • items[in] array of reported items

Returns

true to continue the query, false to abort the query

Public Members

T *mBuffer
PxU32 mCapacity
PxU32 mSize

Current number of items in the buffer. This is entirely managed by the system.