|
RavEngine
|
Returns scene query hits (intersections) to the user in a preallocated buffer. More...
#include <PxQueryReport.h>
Public Member Functions | |
| PxHitBuffer (HitType *aTouches=NULL, PxU32 aMaxNbTouches=0) | |
| Initializes the buffer with user memory. | |
| PX_INLINE PxU32 | getNbAnyHits () const |
| Computes the number of any hits in this result, blocking or touching. | |
| PX_INLINE const HitType & | getAnyHit (const PxU32 index) const |
| Convenience iterator used to access any hits in this result, blocking or touching. | |
| PX_INLINE PxU32 | getNbTouches () const |
| PX_INLINE const HitType * | getTouches () const |
| PX_INLINE const HitType & | getTouch (const PxU32 index) const |
| PX_INLINE PxU32 | getMaxNbTouches () const |
Public Member Functions inherited from physx::PxHitCallback< HitType > | |
| PxHitCallback (HitType *aTouches, PxU32 aMaxNbTouches) | |
| Initializes the class with user provided buffer. | |
| virtual void | finalizeQuery () |
| Query finalization callback, called after the last processTouches callback. | |
| PX_FORCE_INLINE bool | hasAnyHits () |
| Returns true if any blocking or touching hits were encountered during a query. | |
Protected Member Functions | |
| virtual PxAgain | processTouches (const HitType *buffer, PxU32 nbHits) |
| virtual callback function used to communicate query results to the user. | |
Additional Inherited Members | |
Public Attributes inherited from physx::PxHitCallback< HitType > | |
| HitType | block |
| Holds the closest blocking hit result for the query. Invalid if hasBlock is false. | |
| bool | hasBlock |
| Set to true if there was a blocking hit during query. | |
| HitType * | touches |
| User specified buffer for touching hits. | |
| PxU32 | maxNbTouches |
| Size of the user specified touching hits buffer. | |
| PxU32 | nbTouches |
| Number of touching hits returned by the query. Used with PxHitBuffer. | |
Returns scene query hits (intersections) to the user in a preallocated buffer.
Will clip touch hits to maximum buffer capacity. When clipped, an arbitrary subset of touching hits will be discarded. Overflow does not trigger warnings or errors. block and hasBlock will be valid in finalizeQuery callback and after query completion. Touching hits are guaranteed to have closer or same distance ( <= condition) as the globally nearest blocking hit at the time any processTouches() callback is issued.
|
inline |
Initializes the buffer with user memory.
The buffer is initialized with 0 touch hits by default => query will only report a single closest blocking hit. Use PxQueryFlag::eANY_HIT to tell the query to abort and return any first hit encoutered as blocking.
| [in] | aTouches | Optional buffer for recording PxQueryHitType::eTOUCH type hits. |
| [in] | aMaxNbTouches | Size of touch buffer. |
|
inlineprotectedvirtual |
virtual callback function used to communicate query results to the user.
This callback will always be invoked with touches as a buffer if touches was specified as non-NULL. All reported touch hits are guaranteed to be closer than the closest blocking hit.
| [in] | buffer | Callback will report touch hits to the user in this buffer. This pointer will be the same as touches. |
| [in] | nbHits | Number of touch hits reported in buffer. This number will not exceed maxNbTouches. |
Implements physx::PxHitCallback< HitType >.
Reimplemented in NpOverflowBuffer< HitType >.