Public Member Functions | Protected Member Functions | List of all members
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 PxClientID getOwnerClient () const =0
 Retrieves the client specified with PxBatchQueryDesc::ownerClient at creation time. 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 setRunOnSpu (bool runOnSpu)=0
 PS3 only. Enables or disables SPU execution for this query. More...
 
virtual bool getRunOnSpu ()=0
 PS3 only. Returns true if this query should run on SPU. More...
 
virtual void raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal distance=PX_MAX_F32, PxU16 maxTouchHits=0, PxHitFlags hitFlags=PxHitFlag::ePOSITION|PxHitFlag::eNORMAL|PxHitFlag::eDISTANCE, 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::ePOSITION|PxHitFlag::eNORMAL|PxHitFlag::eDISTANCE, 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.

See Also
PxScene, PxScene.createBatchQuery

Constructor & Destructor Documentation

virtual PxBatchQuery::~PxBatchQuery ( )
inlineprotectedvirtual

Member Function Documentation

virtual void PxBatchQuery::execute ( )
pure virtual

Executes batched queries.

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
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
virtual PxClientID PxBatchQuery::getOwnerClient ( ) const
pure virtual

Retrieves the client specified with PxBatchQueryDesc::ownerClient at creation time.

It is not possible to change this value after creating the scene query.

See Also
PxBatchQueryDesc::ownerClient
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
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
virtual bool PxBatchQuery::getRunOnSpu ( )
pure virtual

PS3 only. Returns true if this query should run on SPU.

See Also
PxBatchQueryDesc
virtual const PxBatchQueryMemory& PxBatchQuery::getUserMemory ( )
pure virtual

Gets the user memory pointers.

See Also
PxBatchQueryDesc
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
virtual void PxBatchQuery::raycast ( const PxVec3 origin,
const PxVec3 unitDir,
PxReal  distance = PX_MAX_F32,
PxU16  maxTouchHits = 0,
PxHitFlags  hitFlags = PxHitFlag::ePOSITION|PxHitFlag::eNORMAL|PxHitFlag::eDISTANCE,
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
virtual void PxBatchQuery::release ( )
pure virtual
virtual void PxBatchQuery::setRunOnSpu ( bool  runOnSpu)
pure virtual

PS3 only. Enables or disables SPU execution for this query.

See Also
PxBatchQueryDesc
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
virtual void PxBatchQuery::sweep ( const PxGeometry geometry,
const PxTransform pose,
const PxVec3 unitDir,
const PxReal  distance,
PxU16  maxTouchHits = 0,
PxHitFlags  hitFlags = PxHitFlag::ePOSITION|PxHitFlag::eNORMAL|PxHitFlag::eDISTANCE,
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:


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com