PxBatchQuery Class Referenceabstract

Batched queries object. This is used to perform several queries at the same time. More...

#include <PxBatchQuery.h>

Public Member Functions

virtual void execute ()=0
 Executes batched queries. More...
 
virtual PxBatchQueryPreFilterShader getPreFilterShader () const =0
 Gets the prefilter shader in use for this scene query. More...
 
virtual PxBatchQueryPostFilterShader getPostFilterShader () const =0
 Gets the postfilter shader in use for this scene query. More...
 
virtual const void * getFilterShaderData () const =0
 Gets the shared global filter data in use for this scene query. More...
 
virtual PxU32 getFilterShaderDataSize () const =0
 Gets the size of the shared global filter data (PxSceneDesc.filterShaderData) More...
 
virtual void setUserMemory (const PxBatchQueryMemory &)=0
 Sets new user memory pointers. More...
 
virtual const PxBatchQueryMemorygetUserMemory ()=0
 Gets the user memory pointers. More...
 
virtual void release ()=0
 Releases PxBatchQuery from PxScene. More...
 
virtual void raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal distance=PX_MAX_F32, PxU16 maxTouchHits=0, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), void *userData=NULL, const PxQueryCache *cache=NULL)=0
 Performs a raycast against objects in the scene, returns results in PxBatchQueryMemory::userRaycastResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call. More...
 
virtual void overlap (const PxGeometry &geometry, const PxTransform &pose, PxU16 maxTouchHits=0, const PxQueryFilterData &filterData=PxQueryFilterData(), void *userData=NULL, const PxQueryCache *cache=NULL)=0
 Performs an overlap test of a given geometry against objects in the scene, returns results in PxBatchQueryMemory::userOverlapResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call. More...
 
virtual void sweep (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxU16 maxTouchHits=0, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), void *userData=NULL, const PxQueryCache *cache=NULL, const PxReal inflation=0.f)=0
 Performs a sweep test against objects in the scene, returns results in PxBatchQueryMemory::userSweepResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call. More...
 

Protected Member Functions

virtual ~PxBatchQuery ()
 

Detailed Description

Batched queries object. This is used to perform several queries at the same time.

Deprecated:
The batched query feature has been deprecated in PhysX version 3.4
See also
PxScene, PxScene.createBatchQuery

Constructor & Destructor Documentation

◆ ~PxBatchQuery()

virtual PxBatchQuery::~PxBatchQuery ( )
inlineprotectedvirtual

Member Function Documentation

◆ execute()

virtual void PxBatchQuery::execute ( )
pure virtual

Executes batched queries.

◆ getFilterShaderData()

virtual const void* PxBatchQuery::getFilterShaderData ( ) const
pure virtual

Gets the shared global filter data in use for this scene query.

Returns
Shared filter data for filter shader.
See also
getFilterShaderDataSize() PxBatchQueryDesc.filterShaderData PxBatchQueryPreFilterShader, PxBatchQueryPostFilterShader

◆ getFilterShaderDataSize()

virtual PxU32 PxBatchQuery::getFilterShaderDataSize ( ) const
pure virtual

Gets the size of the shared global filter data (PxSceneDesc.filterShaderData)

Returns
Size of shared filter data [bytes].
See also
getFilterShaderData() PxBatchQueryDesc.filterShaderDataSize PxBatchQueryPreFilterShader, PxBatchQueryPostFilterShader

◆ getPostFilterShader()

virtual PxBatchQueryPostFilterShader PxBatchQuery::getPostFilterShader ( ) const
pure virtual

Gets the postfilter shader in use for this scene query.

Returns
Postfilter shader.
See also
PxBatchQueryDesc.preFilterShade PxBatchQueryPostFilterShader

◆ getPreFilterShader()

virtual PxBatchQueryPreFilterShader PxBatchQuery::getPreFilterShader ( ) const
pure virtual

Gets the prefilter shader in use for this scene query.

Returns
Prefilter shader.
See also
PxBatchQueryDesc.preFilterShade PxBatchQueryPreFilterShader

◆ getUserMemory()

virtual const PxBatchQueryMemory& PxBatchQuery::getUserMemory ( )
pure virtual

Gets the user memory pointers.

See also
PxBatchQueryDesc

◆ overlap()

virtual void PxBatchQuery::overlap ( const PxGeometry geometry,
const PxTransform pose,
PxU16  maxTouchHits = 0,
const PxQueryFilterData filterData = PxQueryFilterData(),
void *  userData = NULL,
const PxQueryCache cache = NULL 
)
pure virtual

Performs an overlap test of a given geometry against objects in the scene, returns results in PxBatchQueryMemory::userOverlapResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call.

Note
Filtering: returning eBLOCK from user filter for overlap queries will cause a warning (see PxQueryHitType).
Parameters
[in]geometryGeometry of object to check for overlap (supported types are: box, sphere, capsule, convex).
[in]posePose of the object.
[in]maxTouchHitsMaximum number of hits to record in the touch buffer for this query. Default=0 reports a single blocking hit. If maxTouchHits is set to 0 all hits are treated as blocking by default.
[in]filterDataFiltering data and simple logic. See PxQueryFilterData PxBatchQueryPreFilterShader, PxBatchQueryPostFilterShader
[in]userDataUser can pass any value in this argument, usually to identify this particular query
[in]cacheCached hit shape (optional). Query is tested against cached shape first. If no hit is found the ray gets queried against the scene. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.
Note
eBLOCK should not be returned from user filters for overlap(). Doing so will result in undefined behavior, and a warning will be issued.
If the PxQueryFlag::eNO_BLOCK flag is set, the eBLOCK will instead be automatically converted to an eTOUCH and the warning suppressed.
This query call writes to a list associated with the query object and is NOT thread safe (for performance reasons there is no lock and overlapping writes from different threads may result in undefined behavior).
See also
PxQueryFilterData PxBatchQueryPreFilterShader PxBatchQueryPostFilterShader

◆ raycast()

virtual void PxBatchQuery::raycast ( const PxVec3 origin,
const PxVec3 unitDir,
PxReal  distance = PX_MAX_F32,
PxU16  maxTouchHits = 0,
PxHitFlags  hitFlags = PxHitFlag::eDEFAULT,
const PxQueryFilterData filterData = PxQueryFilterData(),
void *  userData = NULL,
const PxQueryCache cache = NULL 
)
pure virtual

Performs a raycast against objects in the scene, returns results in PxBatchQueryMemory::userRaycastResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call.

Note
Touching hits are not ordered.
Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in article SceneQuery. User can ignore such objects by using one of the provided filter mechanisms.
Parameters
[in]originOrigin of the ray.
[in]unitDirNormalized direction of the ray.
[in]distanceLength of the ray. Needs to be larger than 0.
[in]maxTouchHitsMaximum number of hits to record in the touch buffer for this query. Default=0 reports a single blocking hit. If maxTouchHits is set to 0 all hits are treated as blocking by default.
[in]hitFlagsSpecifies which properties per hit should be computed and returned in hit array and blocking hit.
[in]filterDataFiltering data passed to the filer shader. See PxQueryFilterData PxBatchQueryPreFilterShader, PxBatchQueryPostFilterShader
[in]userDataUser can pass any value in this argument, usually to identify this particular query
[in]cacheCached hit shape (optional). Query is tested against cached shape first. If no hit is found the ray gets queried against the scene. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.
Note
This query call writes to a list associated with the query object and is NOT thread safe (for performance reasons there is no lock and overlapping writes from different threads may result in undefined behavior).
See also
PxQueryFilterData PxBatchQueryPreFilterShader PxBatchQueryPostFilterShader PxRaycastHit PxScene::raycast

◆ release()

virtual void PxBatchQuery::release ( )
pure virtual

◆ setUserMemory()

virtual void PxBatchQuery::setUserMemory ( const PxBatchQueryMemory )
pure virtual

Sets new user memory pointers.

It is not possible to change the memory during query execute.

See also
PxBatchQueryDesc

◆ sweep()

virtual void PxBatchQuery::sweep ( const PxGeometry geometry,
const PxTransform pose,
const PxVec3 unitDir,
const PxReal  distance,
PxU16  maxTouchHits = 0,
PxHitFlags  hitFlags = PxHitFlag::eDEFAULT,
const PxQueryFilterData filterData = PxQueryFilterData(),
void *  userData = NULL,
const PxQueryCache cache = NULL,
const PxReal  inflation = 0.f 
)
pure virtual

Performs a sweep test against objects in the scene, returns results in PxBatchQueryMemory::userSweepResultBuffer specified at PxBatchQuery creation time or via PxBatchQuery::setUserMemory call.

Note
Touching hits are not ordered.
If a shape from the scene is already overlapping with the query shape in its starting position, the hit is returned unless eASSUME_NO_INITIAL_OVERLAP was specified.
Parameters
[in]geometryGeometry of object to sweep (supported types are: box, sphere, capsule, convex).
[in]posePose of the sweep object.
[in]unitDirNormalized direction of the sweep.
[in]distanceSweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[in]maxTouchHitsMaximum number of hits to record in the touch buffer for this query. Default=0 reports a single blocking hit. If maxTouchHits is set to 0 all hits are treated as blocking by default.
[in]hitFlagsSpecifies which properties per hit should be computed and returned in hit array and blocking hit.
[in]filterDataFiltering data and simple logic. See PxQueryFilterData PxBatchQueryPreFilterShader, PxBatchQueryPostFilterShader
[in]userDataUser can pass any value in this argument, usually to identify this particular query
[in]cacheCached hit shape (optional). Query is tested against cached shape first. If no hit is found the ray gets queried against the scene. Note: Filtering is not executed for a cached shape if supplied; instead, if a hit is found, it is assumed to be a blocking hit. Note: Using past touching hits as cache will produce incorrect behavior since the cached hit will always be treated as blocking.
[in]inflationThis parameter creates a skin around the swept geometry which increases its extents for sweeping. The sweep will register a hit as soon as the skin touches a shape, and will return the corresponding distance and normal. Note: ePRECISE_SWEEP doesn't support inflation. Therefore the sweep will be performed with zero inflation.
Note
This query call writes to a list associated with the query object and is NOT thread safe (for performance reasons there is no lock and overlapping writes from different threads may result in undefined behavior).
See also
PxHitFlags PxQueryFilterData PxBatchQueryPreFilterShader PxBatchQueryPostFilterShader PxSweepHit

The documentation for this class was generated from the following file: