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

Base class for the scene-query system. More...

#include <PxSceneQuerySystem.h>

Inheritance diagram for physx::PxSceneQuerySystemBase:
[legend]

Public Member Functions

Scene Query
virtual void setDynamicTreeRebuildRateHint (PxU32 dynamicTreeRebuildRateHint)=0
 Sets the rebuild rate of the dynamic tree pruning structures.
 
virtual PxU32 getDynamicTreeRebuildRateHint () const =0
 Retrieves the rebuild rate of the dynamic tree pruning structures.
 
virtual void forceRebuildDynamicTree (PxU32 prunerIndex)=0
 Forces dynamic trees to be immediately rebuilt.
 
virtual void setUpdateMode (PxSceneQueryUpdateMode::Enum updateMode)=0
 Sets scene query update mode.
 
virtual PxSceneQueryUpdateMode::Enum getUpdateMode () const =0
 Gets scene query update mode.
 
virtual PxU32 getStaticTimestamp () const =0
 Retrieves the system's internal scene query timestamp, increased each time a change to the static scene query structure is performed.
 
virtual void flushUpdates ()=0
 Flushes any changes to the scene query representation.
 
virtual bool raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxRaycastCallback &hitCall, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.
 
virtual bool sweep (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSweepCallback &hitCall, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, const PxReal inflation=0.0f, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.
 
virtual bool overlap (const PxGeometry &geometry, const PxTransform &pose, PxOverlapCallback &hitCall, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.
 

Detailed Description

Base class for the scene-query system.

Methods defined here are common to both the traditional PxScene API and the PxSceneQuerySystem API.

See also
PxScene PxSceneQuerySystem

Member Function Documentation

◆ flushUpdates()

virtual void physx::PxSceneQuerySystemBase::flushUpdates ( )
pure virtual

Flushes any changes to the scene query representation.

This method updates the state of the scene query representation to match changes in the scene state.

By default, these changes are buffered until the next query is submitted. Calling this function will not change the results from scene queries, but can be used to ensure that a query will not perform update work in the course of its execution.

A thread performing updates will hold a write lock on the query structure, and thus stall other querying threads. In multithread scenarios it can be useful to explicitly schedule the period where this lock may be held for a significant period, so that subsequent queries issued from multiple threads will not block.

Implemented in physx::NpScene.

◆ forceRebuildDynamicTree()

virtual void physx::PxSceneQuerySystemBase::forceRebuildDynamicTree ( PxU32  prunerIndex)
pure virtual

Forces dynamic trees to be immediately rebuilt.

Parameters
[in]prunerIndexIndex of pruner containing the dynamic tree to rebuild
Note
PxScene will call this function with the PX_SCENE_PRUNER_STATIC or PX_SCENE_PRUNER_DYNAMIC value.
See also
PxSceneQueryDesc.dynamicTreeRebuildRateHint setDynamicTreeRebuildRateHint() getDynamicTreeRebuildRateHint()

Implemented in physx::NpScene.

◆ getDynamicTreeRebuildRateHint()

virtual PxU32 physx::PxSceneQuerySystemBase::getDynamicTreeRebuildRateHint ( ) const
pure virtual

Retrieves the rebuild rate of the dynamic tree pruning structures.

Returns
The rebuild rate of the dynamic tree pruning structures.
See also
PxSceneQueryDesc.dynamicTreeRebuildRateHint setDynamicTreeRebuildRateHint() forceRebuildDynamicTree()

Implemented in physx::NpScene.

◆ getStaticTimestamp()

virtual PxU32 physx::PxSceneQuerySystemBase::getStaticTimestamp ( ) const
pure virtual

Retrieves the system's internal scene query timestamp, increased each time a change to the static scene query structure is performed.

Returns
scene query static timestamp

Implemented in physx::NpScene.

◆ getUpdateMode()

virtual PxSceneQueryUpdateMode::Enum physx::PxSceneQuerySystemBase::getUpdateMode ( ) const
pure virtual

Gets scene query update mode.

Returns
Current scene query update mode.
See also
PxSceneQueryUpdateMode::Enum

Implemented in physx::NpScene.

◆ overlap()

virtual bool physx::PxSceneQuerySystemBase::overlap ( const PxGeometry &  geometry,
const PxTransform &  pose,
PxOverlapCallback &  hitCall,
const PxQueryFilterData &  filterData = PxQueryFilterData(),
PxQueryFilterCallback *  filterCall = NULL,
const PxQueryCache *  cache = NULL,
PxGeometryQueryFlags  queryFlags = PxGeometryQueryFlag::eDEFAULT 
) const
pure virtual

Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.

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.
[out]hitCallOverlap hit buffer or callback object used to report overlap hits.
[in]filterDataFiltering data and simple logic. See #PxQueryFilterData #PxQueryFilterCallback
[in]filterCallCustom filtering logic (optional). Only used if the corresponding #PxQueryFlag flags are set. If NULL, all hits are assumed to overlap.
[in]cacheCached hit shape (optional). Overlap is performed against cached shape first. If no hit is found the overlap gets queried against the scene.
[in]queryFlagsOptional flags controlling the query. 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
True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
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.
See also
PxOverlapCallback PxOverlapBuffer PxHitFlags PxQueryFilterData PxQueryFilterCallback PxGeometryQueryFlag

Implemented in physx::NpScene.

◆ raycast()

virtual bool physx::PxSceneQuerySystemBase::raycast ( const PxVec3 &  origin,
const PxVec3 &  unitDir,
const PxReal  distance,
PxRaycastCallback &  hitCall,
PxHitFlags  hitFlags = PxHitFlag::eDEFAULT,
const PxQueryFilterData &  filterData = PxQueryFilterData(),
PxQueryFilterCallback *  filterCall = NULL,
const PxQueryCache *  cache = NULL,
PxGeometryQueryFlags  queryFlags = PxGeometryQueryFlag::eDEFAULT 
) const
pure virtual

Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.

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 user guide article SceneQuery. User can ignore such objects by employing one of the provided filter mechanisms.
Parameters
[in]originOrigin of the ray.
[in]unitDirNormalized direction of the ray.
[in]distanceLength of the ray. Has to be in the [0, inf) range.
[out]hitCallRaycast hit buffer or callback object used to report raycast hits.
[in]hitFlagsSpecifies which properties per hit should be computed and returned via the hit callback.
[in]filterDataFiltering data passed to the filter shader.
[in]filterCallCustom filtering logic (optional). Only used if the corresponding #PxQueryFlag flags are set. If NULL, all hits are assumed to be blocking.
[in]cacheCached hit shape (optional). Ray 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]queryFlagsOptional flags controlling the query.
Returns
True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
See also
PxRaycastCallback PxRaycastBuffer PxQueryFilterData PxQueryFilterCallback PxQueryCache PxRaycastHit PxQueryFlag PxQueryFlag::eANY_HIT PxGeometryQueryFlag

Implemented in physx::NpScene.

◆ setDynamicTreeRebuildRateHint()

virtual void physx::PxSceneQuerySystemBase::setDynamicTreeRebuildRateHint ( PxU32  dynamicTreeRebuildRateHint)
pure virtual

Sets the rebuild rate of the dynamic tree pruning structures.

Parameters
[in]dynamicTreeRebuildRateHintRebuild rate of the dynamic tree pruning structures.
See also
PxSceneQueryDesc.dynamicTreeRebuildRateHint getDynamicTreeRebuildRateHint() forceRebuildDynamicTree()

Implemented in physx::NpScene.

◆ setUpdateMode()

virtual void physx::PxSceneQuerySystemBase::setUpdateMode ( PxSceneQueryUpdateMode::Enum  updateMode)
pure virtual

Sets scene query update mode.

Parameters
[in]updateModeScene query update mode.
See also
PxSceneQueryUpdateMode::Enum

Implemented in physx::NpScene.

◆ sweep()

virtual bool physx::PxSceneQuerySystemBase::sweep ( const PxGeometry &  geometry,
const PxTransform &  pose,
const PxVec3 &  unitDir,
const PxReal  distance,
PxSweepCallback &  hitCall,
PxHitFlags  hitFlags = PxHitFlag::eDEFAULT,
const PxQueryFilterData &  filterData = PxQueryFilterData(),
PxQueryFilterCallback *  filterCall = NULL,
const PxQueryCache *  cache = NULL,
const PxReal  inflation = 0.0f,
PxGeometryQueryFlags  queryFlags = PxGeometryQueryFlag::eDEFAULT 
) const
pure virtual

Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.

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 in [0, inf) range and >0 if eASSUME_NO_INITIAL_OVERLAP was specified. Will be clamped to PX_MAX_SWEEP_DISTANCE.
[out]hitCallSweep hit buffer or callback object used to report sweep hits.
[in]hitFlagsSpecifies which properties per hit should be computed and returned via the hit callback.
[in]filterDataFiltering data and simple logic.
[in]filterCallCustom filtering logic (optional). Only used if the corresponding #PxQueryFlag flags are set. If NULL, all hits are assumed to be blocking.
[in]cacheCached hit shape (optional). Sweep is performed against cached shape first. If no hit is found the sweep 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.
[in]queryFlagsOptional flags controlling the query.
Returns
True if any touching or blocking hits were found or any hit was found in case PxQueryFlag::eANY_HIT was specified.
See also
PxSweepCallback PxSweepBuffer PxQueryFilterData PxQueryFilterCallback PxSweepHit PxQueryCache PxGeometryQueryFlag

Implemented in physx::NpScene.


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