PxBatchQueryExt

Defined in include/extensions/PxSceneQueryExt.h

class PxBatchQueryExt

Public Functions

virtual void release() = 0
virtual PxRaycastBuffer *raycast(const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, const PxU16 maxNbTouches = 0, PxHitFlags hitFlags = PxHitFlags(PxHitFlag::eDEFAULT), const PxQueryFilterData &filterData = PxQueryFilterData(), const PxQueryCache *cache = NULL) = 0

Performs a raycast against objects in the scene.

See also

PxCreateBatchQueryExt

Note

Touching hits are not ordered.

Note

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.

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).

Parameters
  • origin[in] Origin of the ray.

  • unitDir[in] Normalized direction of the ray.

  • distance[in] Length of the ray. Needs to be larger than 0.

  • maxNbTouches[in] Maximum 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.

  • hitFlags[in] Specifies which properties per hit should be computed and returned in hit array and blocking hit.

  • filterData[in] Filtering data passed to the filter shader. See PxQueryFilterData PxQueryFilterCallback

  • cache[in] Cached 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.

Returns

Returns a PxRaycastBuffer pointer that will store the result of the query after execute() is completed. This will point either to an element of the buffer allocated on construction or to a user buffer passed to the constructor.

virtual PxSweepBuffer *sweep(const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, const PxU16 maxNbTouches = 0, PxHitFlags hitFlags = PxHitFlags(PxHitFlag::eDEFAULT), const PxQueryFilterData &filterData = PxQueryFilterData(), const PxQueryCache *cache = NULL, const PxReal inflation = 0.0f) = 0

Performs a sweep test against objects in the scene.

See also

PxCreateBatchQueryExt

See also

PxHitFlags PxQueryFilterData PxBatchQueryPreFilterShader PxBatchQueryPostFilterShader PxSweepHit

Note

Touching hits are not ordered.

Note

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.

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).

Parameters
  • geometry[in] Geometry of object to sweep (supported types are: box, sphere, capsule, convex).

  • pose[in] Pose of the sweep object.

  • unitDir[in] Normalized direction of the sweep.

  • distance[in] Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE.

  • maxNbTouches[in] Maximum 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.

  • hitFlags[in] Specifies which properties per hit should be computed and returned in hit array and blocking hit.

  • filterData[in] Filtering data and simple logic. See PxQueryFilterData PxQueryFilterCallback

  • cache[in] Cached 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.

  • inflation[in] This 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.

Returns

Returns a PxSweepBuffer pointer that will store the result of the query after execute() is completed. This will point either to an element of the buffer allocated on construction or to a user buffer passed to the constructor.

virtual PxOverlapBuffer *overlap(const PxGeometry &geometry, const PxTransform &pose, PxU16 maxNbTouches = 0, const PxQueryFilterData &filterData = PxQueryFilterData(), const PxQueryCache *cache = NULL) = 0

Performs an overlap test of a given geometry against objects in the scene.

See also

PxCreateBatchQueryExt

Note

Filtering: returning eBLOCK from user filter for overlap queries will cause a warning (see PxQueryHitType).

Note

eBLOCK should not be returned from user filters for overlap(). Doing so will result in undefined behavior, and a warning will be issued.

Note

If the PxQueryFlag::eNO_BLOCK flag is set, the eBLOCK will instead be automatically converted to an eTOUCH and the warning suppressed.

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).

Parameters
  • geometry[in] Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex).

  • pose[in] Pose of the object.

  • maxNbTouches[in] Maximum 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.

  • filterData[in] Filtering data and simple logic. See PxQueryFilterData PxQueryFilterCallback

  • cache[in] Cached 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.

Returns

Returns a PxOverlapBuffer pointer that will store the result of the query after execute() is completed. This will point either to an element of the buffer allocated on construction or to a user buffer passed to the constructor.

virtual void execute() = 0

Protected Functions

inline virtual ~PxBatchQueryExt()