PxOverlapBufferN
Defined in include/PxQueryReport.h
Inheritance Relationships
Base Type
public PxHitBuffer< PxOverlapHit >
(PxHitBuffer)
-
template<int N>
struct PxOverlapBufferN : public PxHitBuffer<PxOverlapHit> Returns touching overlap hits to the user in a fixed size array embedded in the buffer class.
Public Functions
-
inline PxOverlapBufferN()
-
inline PxU32 getNbAnyHits() const
Computes the number of any hits in this result, blocking or touching.
-
inline const PxOverlapHit &getAnyHit(const PxU32 index) const
Convenience iterator used to access any hits in this result, blocking or touching.
-
inline const PxOverlapHit *getTouches() const
-
inline const PxOverlapHit &getTouch(const PxU32 index) const
-
inline virtual void finalizeQuery()
Query finalization callback, called after the last processTouches callback.
-
inline bool hasAnyHits()
Returns true if any blocking or touching hits were encountered during a query.
Public Members
-
PxOverlapHit hits[N]
-
PxOverlapHit 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.
-
PxOverlapHit *touches
User specified buffer for touching hits.
-
PxU32 maxNbTouches
Size of the user specified touching hits buffer.
Note
If set to 0 all hits will default to PxQueryHitType::eBLOCK, otherwise to PxQueryHitType::eTOUCH
Note
Hit type returned from pre-filter overrides this default
-
PxU32 nbTouches
Number of touching hits returned by the query.
Used with PxHitBuffer.
Note
If true (PxAgain) is returned from the callback, nbTouches will be reset to 0.
Protected Functions
-
inline virtual PxAgain processTouches(const PxOverlapHit *buffer, PxU32 nbHits)
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.
See also
Note
There is a significant performance penalty in case multiple touch callbacks are issued (up to 2x)
Note
to avoid the penalty use a bigger buffer so that all touching hits can be reported in a single buffer.
Note
If true (again) is returned from the callback, nbTouches will be reset to 0,
Note
If false is returned, nbTouched will remain unchanged.
Note
By the time processTouches is first called, the globally closest blocking hit is already determined,
Note
values of hasBlock and block are final and all touch hits are guaranteed to be closer than the blocking hit.
Note
touches and maxNbTouches can be modified inside of processTouches callback.
- Parameters
buffer – [in] Callback will report touch hits to the user in this buffer. This pointer will be the same as touches.
nbHits – [in] Number of touch hits reported in buffer. This number will not exceed maxNbTouches.
- Returns
true to continue receiving callbacks in case there are more hits or false to stop.
-
inline PxOverlapBufferN()