RavEngine
Loading...
Searching...
No Matches
physx::PxQueryFilterCallback Class Referenceabstract

Scene query filtering callbacks. More...

#include <PxQueryFiltering.h>

Inheritance diagram for physx::PxQueryFilterCallback:
[legend]

Public Member Functions

virtual PxQueryHitType::Enum preFilter (const PxFilterData &filterData, const PxShape *shape, const PxRigidActor *actor, PxHitFlags &queryFlags)=0
 This filter callback is executed before the exact intersection test if PxQueryFlag::ePREFILTER flag was set.
 
virtual PX_DEPRECATED PxQueryHitType::Enum postFilter (const PxFilterData &filterData, const PxQueryHit &hit)
 This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTFILTER flag was set.
 
virtual PxQueryHitType::Enum postFilter (const PxFilterData &filterData, const PxQueryHit &hit, const PxShape *shape, const PxRigidActor *actor)
 This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTFILTER flag was set.
 
virtual ~PxQueryFilterCallback ()
 virtual destructor
 

Detailed Description

Scene query filtering callbacks.

Custom filtering logic for scene query intersection candidates. If an intersection candidate object passes the data based filter (see #PxQueryFilterData), filtering callbacks are executed if requested (see PxQueryFilterData.flags)

The preFilter function may overwrite the copy of queryFlags it receives as an argument to specify any of PxHitFlag::eMODIFIABLE_FLAGS on a per-shape basis. Changes apply only to the shape being filtered, and changes to other flags are ignored.

  • If PxQueryFlag::ePREFILTER is not set, precise intersection testing is performed using the original query's filterData.flags.
  • If PxQueryFlag::ePOSTFILTER is set, the postFilter function is called for each intersection to determine the touch/block status. This overrides any touch/block status previously returned from the preFilter function for this shape.

Filtering calls are not guaranteed to be sorted along the ray or sweep direction.

See also
PxScene.raycast PxScene.sweep PxScene.overlap PxQueryFlags PxHitFlags

Member Function Documentation

◆ postFilter() [1/2]

virtual PX_DEPRECATED PxQueryHitType::Enum physx::PxQueryFilterCallback::postFilter ( const PxFilterData &  filterData,
const PxQueryHit &  hit 
)
inlinevirtual

This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTFILTER flag was set.

Parameters
[in]filterDatacustom filter data of the query
[in]hitScene query hit information. faceIndex member is not valid for overlap queries. For sweep and raycast queries the hit information can be cast to #PxSweepHit and #PxRaycastHit respectively.
Returns
the updated hit type for this hit (see #PxQueryHitType)
Deprecated:

◆ postFilter() [2/2]

virtual PxQueryHitType::Enum physx::PxQueryFilterCallback::postFilter ( const PxFilterData &  filterData,
const PxQueryHit &  hit,
const PxShape *  shape,
const PxRigidActor *  actor 
)
inlinevirtual

This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTFILTER flag was set.

Parameters
[in]filterDatacustom filter data of the query
[in]hitScene query hit information. faceIndex member is not valid for overlap queries. For sweep and raycast queries the hit information can be cast to #PxSweepHit and #PxRaycastHit respectively.
[in]shapeHit shape
[in]actorHit actor
Returns
the updated hit type for this hit (see #PxQueryHitType)

Reimplemented in CCDRaycastFilterCallback.

◆ preFilter()

virtual PxQueryHitType::Enum physx::PxQueryFilterCallback::preFilter ( const PxFilterData &  filterData,
const PxShape *  shape,
const PxRigidActor *  actor,
PxHitFlags &  queryFlags 
)
pure virtual

This filter callback is executed before the exact intersection test if PxQueryFlag::ePREFILTER flag was set.

Parameters
[in]filterDatacustom filter data specified as the query's filterData.data parameter.
[in]shapeA shape that has not yet passed the exact intersection test.
[in]actorThe shape's actor.
[in,out]queryFlagsscene query flags from the query's function call (only flags from PxHitFlag::eMODIFIABLE_FLAGS bitmask can be modified)
Returns
the updated type for this hit (see #PxQueryHitType)

Implemented in CCDRaycastFilterCallback.


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