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

Traditional SQ system for PxScene. More...

#include <PxSceneQuerySystem.h>

Inheritance diagram for physx::PxSceneSQSystem:
[legend]
Collaboration diagram for physx::PxSceneSQSystem:
[legend]

Public Member Functions

Scene Query
PX_FORCE_INLINE void setSceneQueryUpdateMode (PxSceneQueryUpdateMode::Enum updateMode)
 Sets scene query update mode.
 
PX_FORCE_INLINE PxSceneQueryUpdateMode::Enum getSceneQueryUpdateMode () const
 Gets scene query update mode.
 
PX_FORCE_INLINE PxU32 getSceneQueryStaticTimestamp () const
 Retrieves the scene's internal scene query timestamp, increased each time a change to the static scene query structure is performed.
 
PX_FORCE_INLINE void flushQueryUpdates ()
 Flushes any changes to the scene query representation.
 
PX_FORCE_INLINE void forceDynamicTreeRebuild (bool rebuildStaticStructure, bool rebuildDynamicStructure)
 Forces dynamic trees to be immediately rebuilt.
 
virtual PxPruningStructureType::Enum getStaticStructure () const =0
 Return the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScene.
 
virtual PxPruningStructureType::Enum getDynamicStructure () const =0
 Return the value of PxSceneQueryDesc::dynamicStructure that was set when creating the scene with PxPhysics::createScene.
 
virtual void sceneQueriesUpdate (PxBaseTask *completionTask=NULL, bool controlSimulation=true)=0
 Executes scene queries update tasks.
 
virtual bool checkQueries (bool block=false)=0
 This checks to see if the scene queries update has completed.
 
virtual bool fetchQueries (bool block=false)=0
 
- Public Member Functions inherited from physx::PxSceneQuerySystemBase
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

Traditional SQ system for PxScene.

Methods defined here are only available through the traditional PxScene API. Thus PxSceneSQSystem effectively captures the scene-query related part of the PxScene API.

See also
PxScene PxSceneQuerySystemBase

Member Function Documentation

◆ checkQueries()

virtual bool physx::PxSceneSQSystem::checkQueries ( bool  block = false)
pure virtual

This checks to see if the scene queries update has completed.

This does not cause the data available for reading to be updated with the results of the scene queries update, it is simply a status check. The bool will allow it to either return immediately or block waiting for the condition to be met so that it can return true

Parameters
[in]blockWhen set to true will block until the condition is met.
Returns
True if the results are available.
See also
sceneQueriesUpdate() fetchResults()

Implemented in physx::NpScene.

◆ fetchQueries()

virtual bool physx::PxSceneSQSystem::fetchQueries ( bool  block = false)
pure virtual

This method must be called after sceneQueriesUpdate. It will wait for the scene queries update to finish. If the user makes an illegal scene queries update call, the SDK will issue an error message.

If a new AABB tree build finished, then during fetchQueries the current tree within the pruning structure is swapped with the new tree.

Parameters
[in]blockWhen set to true will block until the condition is met, which is tree built task must finish running.

Implemented in physx::NpScene.

◆ flushQueryUpdates()

PX_FORCE_INLINE void physx::PxSceneSQSystem::flushQueryUpdates ( )
inline

Flushes any changes to the scene query representation.

See also
flushUpdates

◆ forceDynamicTreeRebuild()

PX_FORCE_INLINE void physx::PxSceneSQSystem::forceDynamicTreeRebuild ( bool  rebuildStaticStructure,
bool  rebuildDynamicStructure 
)
inline

Forces dynamic trees to be immediately rebuilt.

Parameters
[in]rebuildStaticStructureTrue to rebuild the dynamic tree containing static objects
[in]rebuildDynamicStructureTrue to rebuild the dynamic tree containing dynamic objects
See also
PxSceneQueryDesc.dynamicTreeRebuildRateHint setDynamicTreeRebuildRateHint() getDynamicTreeRebuildRateHint()

◆ getDynamicStructure()

virtual PxPruningStructureType::Enum physx::PxSceneSQSystem::getDynamicStructure ( ) const
pure virtual

Return the value of PxSceneQueryDesc::dynamicStructure that was set when creating the scene with PxPhysics::createScene.

See also
PxSceneQueryDesc::dynamicStructure, PxPhysics::createScene

Implemented in physx::NpScene.

◆ getSceneQueryStaticTimestamp()

PX_FORCE_INLINE PxU32 physx::PxSceneSQSystem::getSceneQueryStaticTimestamp ( ) const
inline

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

Returns
scene query static timestamp

◆ getSceneQueryUpdateMode()

PX_FORCE_INLINE PxSceneQueryUpdateMode::Enum physx::PxSceneSQSystem::getSceneQueryUpdateMode ( ) const
inline

Gets scene query update mode.

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

◆ getStaticStructure()

virtual PxPruningStructureType::Enum physx::PxSceneSQSystem::getStaticStructure ( ) const
pure virtual

Return the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScene.

See also
PxSceneQueryDesc::staticStructure, PxPhysics::createScene

Implemented in physx::NpScene.

◆ sceneQueriesUpdate()

virtual void physx::PxSceneSQSystem::sceneQueriesUpdate ( PxBaseTask *  completionTask = NULL,
bool  controlSimulation = true 
)
pure virtual

Executes scene queries update tasks.

This function will refit dirty shapes within the pruner and will execute a task to build a new AABB tree, which is build on a different thread. The new AABB tree is built based on the dynamic tree rebuild hint rate. Once the new tree is ready it will be commited in next fetchQueries call, which must be called after.

This function is equivalent to the following PxSceneQuerySystem calls: Synchronous calls:

  • PxSceneQuerySystemBase::flushUpdates()
  • handle0 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_STATIC)
  • handle1 = PxSceneQuerySystem::prepareSceneQueryBuildStep(PX_SCENE_PRUNER_DYNAMIC) Asynchronous calls:
  • PxSceneQuerySystem::sceneQueryBuildStep(handle0);
  • PxSceneQuerySystem::sceneQueryBuildStep(handle1);

This function is part of the PxSceneSQSystem interface because it uses the PxScene task system under the hood. But it calls PxSceneQuerySystem functions, which are independent from this system and could be called in a similar fashion by a separate, possibly user-defined task manager.

Note
If PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED is used, it is required to update the scene queries using this function.
Parameters
[in]completionTaskif non-NULL, this task will have its refcount incremented in sceneQueryUpdate(), then decremented when the scene is ready to have fetchQueries called. So the task will not run until the application also calls removeReference().
[in]controlSimulationif true, the scene controls its PxTaskManager simulation state. Leave true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
See also
PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED

Implemented in physx::NpScene.

◆ setSceneQueryUpdateMode()

PX_FORCE_INLINE void physx::PxSceneSQSystem::setSceneQueryUpdateMode ( PxSceneQueryUpdateMode::Enum  updateMode)
inline

Sets scene query update mode.

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

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