29#ifndef PX_QUERY_REPORT_H
30#define PX_QUERY_REPORT_H
34#include "foundation/PxVec3.h"
35#include "foundation/PxFlags.h"
36#include "foundation/PxAssert.h"
37#include "geometry/PxGeometryHit.h"
38#include "geometry/PxGeometryQueryContext.h"
39#include "PxPhysXConfig.h"
93template<
typename HitType>
170template<
typename HitType>
189 return index < getNbTouches() ? getTouches()[index] : this->
block; }
193 PX_INLINE const HitType& getTouch(
const PxU32 index)
const { PX_ASSERT(index < getNbTouches());
return getTouches()[index]; }
196 virtual ~PxHitBuffer() {}
200 virtual PxAgain processTouches(
const HitType* buffer, PxU32 nbHits) { PX_UNUSED(buffer); PX_UNUSED(nbHits);
return false; }
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Abstract class for collision shapes.
Definition PxShape.h:146
#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
PxHitBuffer< PxSweepHit > PxSweepBuffer
Sweep query buffer.
Definition PxQueryReport.h:219
bool PxAgain
Describes query behavior after returning a partial query result via a callback.
Definition PxQueryReport.h:78
PxHitBuffer< PxOverlapHit > PxOverlapBuffer
Overlap query buffer.
Definition PxQueryReport.h:216
PxHitBuffer< PxRaycastHit > PxRaycastBuffer
Raycast query buffer.
Definition PxQueryReport.h:213
PxHitCallback< PxOverlapHit > PxOverlapCallback
Overlap query callback.
Definition PxQueryReport.h:207
PxHitCallback< PxRaycastHit > PxRaycastCallback
Raycast query callback.
Definition PxQueryReport.h:204
PxHitCallback< PxSweepHit > PxSweepCallback
Sweep query callback.
Definition PxQueryReport.h:210
Combines a shape pointer and the actor the shape belongs to into one memory location.
Definition PxQueryReport.h:57
Stores results of overlap queries.
Definition PxGeometryHit.h:165
Stores results of raycast queries.
Definition PxGeometryHit.h:151
Stores results of sweep queries.
Definition PxGeometryHit.h:175
Returns scene query hits (intersections) to the user in a preallocated buffer.
Definition PxQueryReport.h:172
PX_INLINE const HitType & getAnyHit(const PxU32 index) const
Convenience iterator used to access any hits in this result, blocking or touching.
Definition PxQueryReport.h:188
virtual PxAgain processTouches(const HitType *buffer, PxU32 nbHits)
virtual callback function used to communicate query results to the user.
Definition PxQueryReport.h:200
PxHitBuffer(HitType *aTouches=NULL, PxU32 aMaxNbTouches=0)
Initializes the buffer with user memory.
Definition PxQueryReport.h:183
PX_INLINE PxU32 getNbAnyHits() const
Computes the number of any hits in this result, blocking or touching.
Definition PxQueryReport.h:186
This callback class facilitates reporting scene query hits (intersections) to the user.
Definition PxQueryReport.h:95
bool hasBlock
Set to true if there was a blocking hit during query.
Definition PxQueryReport.h:97
virtual PxAgain processTouches(const HitType *buffer, PxU32 nbHits)=0
virtual callback function used to communicate query results to the user.
HitType block
Holds the closest blocking hit result for the query. Invalid if hasBlock is false.
Definition PxQueryReport.h:96
PxU32 maxNbTouches
Size of the user specified touching hits buffer.
Definition PxQueryReport.h:105
PxU32 nbTouches
Number of touching hits returned by the query. Used with PxHitBuffer.
Definition PxQueryReport.h:110
PX_FORCE_INLINE bool hasAnyHits()
Returns true if any blocking or touching hits were encountered during a query.
Definition PxQueryReport.h:154
HitType * touches
User specified buffer for touching hits.
Definition PxQueryReport.h:99
virtual void finalizeQuery()
Query finalization callback, called after the last processTouches callback.
Definition PxQueryReport.h:149
PxHitCallback(HitType *aTouches, PxU32 aMaxNbTouches)
Initializes the class with user provided buffer.
Definition PxQueryReport.h:123
Returns touching overlap hits to the user in a fixed size array embedded in the buffer class.
Definition PxQueryReport.h:232
Definition PxQueryReport.h:67
single hit cache for scene queries.
Definition PxQueryReport.h:264
PxShape * shape
Shape to test for intersection first.
Definition PxQueryReport.h:275
PX_INLINE PxQueryCache(PxShape *s, PxU32 findex)
constructor to set properties
Definition PxQueryReport.h:273
PX_INLINE PxQueryCache()
constructor sets to default
Definition PxQueryReport.h:268
PxRigidActor * actor
Actor to which the shape belongs.
Definition PxQueryReport.h:276
PxU32 faceIndex
Triangle index to test first - NOT CURRENTLY SUPPORTED.
Definition PxQueryReport.h:277
A per-thread context passed to low-level query functions.
Definition PxGeometryQueryContext.h:52
Returns touching raycast hits to the user in a fixed size array embedded in the buffer class.
Definition PxQueryReport.h:224
Definition PxQueryReport.h:66
Returns touching sweep hits to the user in a fixed size array embedded in the buffer class.
Definition PxQueryReport.h:240
Definition PxQueryReport.h:68